Hi,

I am doing some work on a nodejs/v8 bindings for libmysqlclient and
ran into some questions while working on the asynchronous part of the
interface.
http://github.com/kreetitech/node-mysql-libmysqlclient

The documentation says that:

"mysql_query() cannot be used for statements that contain binary data;
you must use mysql_real_query() instead.
In addition, mysql_real_query() is faster than mysql_query() because
it does not call strlen() on the statement string."

Besides these, I found another important difference, it is possible to
call mysql_query followed by mysql_store_result multiple times and
have separate MYSQL_RES objects which work.

Meaning:

    mysql_query(conn. 'some select query....');
    res1 = mysql_store_result(conn)

    mysql_query(conn. 'some other select query....');
    res2 = mysql_store_result(conn)

   mysql_fetch_row(res1)
   mysql_fetch_row(res2)


But the above doesn't work with mysql_real_query, if returns error
code CR_COMMANDS_OUT_OF_SYNC.
mysql_real_query expects that all the results have been fetched,
before it can be called again.

Is the behavior of mysql_query, as expected, and something which can
be relied upon? Can res1 and res2 be assumed to be independent?
Why does mysql_real_query behaves differently?

mysql_send_query is not  a documented function, is there any reason for that?

Your help will be appreciated.

Thanks!
-- 
Surendra Singhi

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=arch...@jab.org

Reply via email to