1. I have configured CUBRID SHARD with MySQL 5.1 backend. There are 2 shards configured (10.11.12.13, 10.11.12.14) with SHARD Broker on 10.11.12.14:45011.
2. MySQL *sharddb* schema is attached.
3. The Node.js code I'm running is attached. It setEnforceOldQueryProtocol(true); to allow sharding broker usage.
4. The program adds the following two queries to the queue via addQuery():
{code}
SELECT * FROM tbl_posts /*+ shard_id(0) */
SELECT * FROM tbl_posts /*+ shard_id(1) */
{code}
5. Running *node 1-populate-table.js* gives the following output
{code}
[vagrant@node2 nodejs]$ node 1-populate-table.js
Connected
SELECT * FROM tbl_posts /*+ shard_id(0) */
Shard(0) holds null records
SELECT * FROM tbl_posts /*+ shard_id(1) */
{code}
In the output you can notice that the result is returned for the first *shard_id(0)* query, while the result for the second *shard_id(1)* is never returned.
If I switch the order of queries, anyway the second one in the queue doesn't receive socket data from the server.
I've written the same code using JDBC, in which case, the program works fine: both queries are executed successfully. But with node-cubrid they are not.
When I added console.log() in *_queryOldProtocol()*, I've noticed that the following code on line 869 is never called which makes node-cubrid hang endlessly.
{code}
self._socket.on('data', function (data) {
{code}
Please reproduce this scenario and let me know if I'm doing something wrong. Let me know if you need more information from me.
Also I haven't tried with CUBRID backend.