Lazarus 2.0.4, ZeosLib 7.2.4 and MariaDB

In this forum you may discuss all issues concerning the Lazarus IDE and Freepascal (both running on Windows or Linux).

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
radug
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 05.09.2019, 10:39

Lazarus 2.0.4, ZeosLib 7.2.4 and MariaDB

Post by radug »

Hi,

This is my first attempt to use Lazarus 2.0.4 (Win 10 64bit) with ZeosLib. I'm trying to create an application to manage an MariaDB/MySQL database. With little success so far.
I can use TZStoredProc and TZTable without problems but when I try to use TZQuery or TZReadOnlyQuery the program freezes upon the instruction:

Code: Select all

ZQuery1.Open;
or alternatively:

Code: Select all

ZQuery1.Active := true;
The code looks like this:

Code: Select all

procedure TForm1.ButtonConnectClick(Sender: TObject);
begin
  ZConnection1.Connected := true;
  ZQuery1.Close;
  ZQuery1.SQL.Clear; 
  ZQuery1.SQL.Text := 'SELECT * FROM table_users';
  ZQuery1.Active := true; // app freezes here!
  //ZQuery1.Open;
end;
For MariaDB 5.5, I use libmariadb.dll v3.1.3 and for MySQL 5.5, the connector libmysql.dll v5.5.62.

If I use TMysqlConnection55 and TSqlQuery the application works as expected.

Any ideas?

Thank you & Best regards,
Radu G.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Lazarus 2.0.4, ZeosLib 7.2.4 and MariaDB

Post by marsupilami »

Hello Radu,

could you share the table layout (create script) and maybe some sample data that produces the error? Also did you already try the svn version of Zeos 7.2?
Best regards,

Jan
radug
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 05.09.2019, 10:39

Re: Lazarus 2.0.4, ZeosLib 7.2.4 and MariaDB

Post by radug »

Hi Jan,

Thank you for your answer!

This is actually a very simple application. The table structure is :

DROP TABLE IF EXISTS `table_downloads`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `table_downloads` (
`DOWNLOAD_GUID` varchar(45) NOT NULL,
`DOWNLOAD_TIME` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`DOWNLOAD_COUNT` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`DOWNLOAD_GUID`),
UNIQUE KEY `DOWNLOAD_ID_UNIQUE` (`DOWNLOAD_GUID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;

And data is :

LOCK TABLES `table_downloads` WRITE;
/*!40000 ALTER TABLE `table_downloads` DISABLE KEYS */;
INSERT INTO `table_downloads` VALUES
('1111-2222-3333-4444-8ED6-C7A8-C933-B73B','2019-07-11 11:40:53',2),
('7777-8888-9999-0000-A1FC-4509-4968-D3EA','2019-07-11 08:32:49',1),
('5555-6666-7777-AAAA-9375-5532-603B-9163','2019-02-21 21:05:00',0),
('BBBB-FFFF-2222-3333-8F14-E3D4-3328-3F55','2019-07-11 08:32:20',2);
/*!40000 ALTER TABLE `table_downloads` ENABLE KEYS */;
UNLOCK TABLES;

The code is really simple:
Components used:
ZConnect1
ZReadOnly1( or ZQuery1)
DataSource1
DBGrid1=>DataSource1
DBNavigator1=>DataSource1

Code used:

Code: Select all

procedure TForm1.ButtonConnectClick(Sender: TObject); 
begin
  ZConnection1.Connected := true;
  ZReadOnlyQuery1.Close;
  ZReadOnlyQuery1.SQL.Clear;
  ZReadOnlyQuery1.SQL.Text :=  'SELECT * FROM table_downloads;' ; 
  ZReadOnlyQuery1.Open;  
  //ZReadOnlyQuery1.Active := true;
end;
I also have to mention that I can use ZTable1 or ZStoredProc1 without any problems with both servers.

==================================================

If I use libmysql.dll anfd MySQL server (local instance) I get this error message:
zeoslib_error.png
before crashing!

If I use libmariadb.dll and MariaDB server (remote instance) the application just freezes!

==================================================
> Also did you already try the svn version of Zeos 7.2?
No, I did not.

Regards,
Radu G.
You do not have the required permissions to view the files attached to this post.
radug
Fresh Boarder
Fresh Boarder
Posts: 4
Joined: 05.09.2019, 10:39

Re: Lazarus 2.0.4, ZeosLib 7.2.4 and MariaDB

Post by radug »

Hi Jan,

I installed and compiled the last svn version of Zeos 7.2. Same behavior but error occurs now at line 792.

Regards,
Radu G.
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: Lazarus 2.0.4, ZeosLib 7.2.4 and MariaDB

Post by marsupilami »

Hello Radu,

I just want to let you know that I didn't forget about this case. I just didn't get to do a test setup yet.

Best regards,

Jan
Post Reply