Bug #6407
closedError running test.mysql
0%
Description
Hi,
I've been trying to use the MySQL connector but queries that have belongsTo() are causing an error while reading values from SqlStatement. I tried running test.mysql project on a fresh MariaDB install on Ubuntu and I'm still getting the same error:
unknown location(0): fatal error: in "dbo_test1": Wt::Dbo::backend::MySQLException: MySQL: getResult(): truncated result for column 2
unknown location(0): fatal error: in "dbo_test2": Wt::Dbo::backend::MySQLException: MySQL: getResult(): truncated result for column 2
unknown location(0): fatal error: in "dbo_test14": Wt::Dbo::backend::MySQLException: MySQL: getResult(): truncated result for column 2
unknown location(0): fatal error: in "dbo_test23a": Wt::Dbo::backend::MySQLException: MySQL: getResult(): truncated result for column 2
... and so on
Any idea what's wrong?
Files
Updated by Saif Rehman over 6 years ago
I confirmed it on another PC running Windows so its not an external problem
Updated by Saif Rehman over 6 years ago
I've tried it on
- Ubuntu 18.04
- with XAMPP (LAMPP)'s MariaDB 10.1.29
- with Ubuntu's repository's MariaDB 10.1
- Windows 10 XAMPP's MariaDB 10.1.29
Updated by Saif Rehman over 6 years ago
I tried using MySQL 5.7 and I didn't get the same errors, HOWEVER, there was a different error this time:
fatal error: in "dbo_test1": critical check *a2 == a1 has failed
Updated by Saif Rehman over 6 years ago
https://drive.google.com/open?id=1-UpyiGofrEiEMFxOMMDUVgId_ZJ6MakN
Here's a VirtualBox OVA file that you can import using VirtualBox and run it. I've installed Ubuntu 18.04 from the image file on the website and everything else from apt-get including git, cmake, mariadb-server, libmariadb3, libmariadb-dev, libboost-*, and whatever other dependency there was.
Username: user
Password: 123456
Wt source path: ~/wt
Run ~/wt/build/test/test.mysql and you will see that there will be multiple fatal errors reporting errors like: Wt::Dbo::backend::MySQLException: MySQL: getResult(): truncated result for column 2
Updated by Saif Rehman over 6 years ago
(For Ubuntu only) As pointed out by Roel, the problem is only present when using the libmariadb-dev package, however, the MySQL backend works without any problems when using the libmariadbclient-dev package instead.
Updated by Olaf Bonorden over 6 years ago
Same bug for OpenSuSE tumbleweed with mariadb-10.2.15-2.2, result looks ok (colum type in my example is DateTime), but maria db seems to set error code to 2 (or maybe just forget to reset it?)
Furthermore, I think there is a memory leak in MySQL.C in bind_output, I will open another issue for that.
Updated by Olaf Bonorden over 6 years ago
Resetting error flag before calling mysql_stmt_bind_result seems to work.
Updated by Roel Standaert over 6 years ago
- Status changed from New to Resolved
Thanks, Olaf. I changed the implementation so now it makes sure to clear the error before it fetches the result.
Updated by Roel Standaert over 6 years ago
- Status changed from Resolved to Closed