select bit field from mariadb always returns 0
Original Reporter info from Mantis: kinlion
-
Reporter name: Kinlion Yan
Original Reporter info from Mantis: kinlion
- Reporter name: Kinlion Yan
Description:
When open a sql with command "SELECT A_BIT_FIELD FROM some_table",
the result Fields[0].AsInteger is always 0, no matter what the real value in database.
Environment:
Server: Ubuntu 18.04
Database: MariaDB 10.4.13
Client: Win10 x64
Lazarus 2.0.8 + FPC 3.0.4
Connection: TMySQL56Connection
Steps to reproduce:
-
Create a table in a database
CREATE TABLE test_bit(flag BIT(1));
-
Insert a value for test
INSERT INTO test_bit(flag) VALUES(1);
-
Open a TSQLQuery to get the bit value
SELECT * FROM test_bit;
-
The result Fields[0].AsInteger is 0
Additional information:
The attachment is the libmysql.dll which I used to open database. I got it from HeidiSQL.
https://forum.lazarus.freepascal.org/index.php/topic,49980.msg363806.html#msg363806
Mantis conversion info:
- Mantis ID: 37169
- Build: 62944
- Version: 3.0.4