Project

General

Profile

Actions

Bug #6407

closed

Error running test.mysql

Added by Saif Rehman over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
High
Assignee:
-
Target version:
-
Start date:
05/29/2018
Due date:
% Done:

0%

Estimated time:

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

wt-mysql-error-flag.patch (485 Bytes) wt-mysql-error-flag.patch patch to reset error flag Olaf Bonorden, 06/18/2018 11:59 PM
Actions #1

Updated by Saif Rehman over 6 years ago

I confirmed it on another PC running Windows so its not an external problem

Actions #2

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
Actions #3

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
Actions #4

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

Actions #5

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.

Actions #6

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.

Actions #7

Updated by Olaf Bonorden over 6 years ago

Resetting error flag before calling mysql_stmt_bind_result seems to work.

Actions #8

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.

Actions #9

Updated by Roel Standaert over 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF