I was using libzdb to save data to a sqlite database. Now I've decided to try MySQL but I've found that it saves integer data as wrong values. I've attached a test program. It creates the same table in a sqlite database and mysql database, then it adds a row to each of them. When I make a query in sqlite I get the right value but in MySQL all the integer values are replaced by 1.
I'm using Ubuntu Edgy (6.10) with MySQL 5.0.24a (the official Ubuntu version) and 3.3.5 (official too).
Running the test, I get the following in mysql:
mysql> select * from Operations; +---------+-----------+--------+------+--------+------+------+------+------+------+------------------------+ | transId | timestamp | isUndo | seq | opName | arg1 | arg2 | arg3 | arg4 | arg5 | saveBlob | +---------+-----------+--------+------+--------+------+------+------+------+------+------------------------+ | trans1 | timestamp | 1 | 1 | 1 | arg1 | arg2 | NULL | NULL | NULL | Very Large Binary Blob | +---------+-----------+--------+------+--------+------+------+------+------+------+------------------------+ 1 row in set (0.00 sec)
Thanks for the report! This was a bug that occurs if you used two or more number parameters in a MySQL prepared statement. The just released version 1.1.3 should fix this issue.
Best regards -- Jan-Henrik Haukeland http://tildeslash.com/
On 7. feb. 2007, at 14.18, José Antonio Sánchez wrote:
I was using libzdb to save data to a sqlite database. Now I've decided to try MySQL but I've found that it saves integer data as wrong values. I've attached a test program. It creates the same table in a sqlite database and mysql database, then it adds a row to each of them. When I make a query in sqlite I get the right value but in MySQL all the integer values are replaced by 1.
I'm using Ubuntu Edgy (6.10) with MySQL 5.0.24a (the official Ubuntu version) and 3.3.5 (official too).
Running the test, I get the following in mysql:
mysql> select * from Operations; +---------+-----------+--------+------+--------+------+------+------ +------+------+------------------------+ | transId | timestamp | isUndo | seq | opName | arg1 | arg2 | arg3 | arg4 | arg5 | saveBlob | +---------+-----------+--------+------+--------+------+------+------ +------+------+------------------------+ | trans1 | timestamp | 1 | 1 | 1 | arg1 | arg2 | NULL | NULL | NULL | Very Large Binary Blob | +---------+-----------+--------+------+--------+------+------+------ +------+------+------------------------+ 1 row in set (0.00 sec)
-- Saludos. José Antonio Sánchez
<test_database.c>
To unsubscribe: http://www.tildeslash.com/mailman/listinfo/libzdb-general