|
Post by xstreur on Apr 20, 2021 7:53:00 GMT 1
Hello,
Working with the mysql-sample.bac and the include/mysql.bac results in a Memory fault. I have put TRACE ON after the include and this is what I keep seeing:
File 'mysql_sample.bac' line 8: TRACE ON - press <SPACE> to execute the program step by step, <ESC> to exit. File 'mysql_sample.bac' line 11: DECLARE NUL TYPE STRING File 'mysql_sample.bac' line 14: DECLARE row TYPE long* File 'mysql_sample.bac' line 17: db = mysql_init(0) File 'mysql_sample.bac' line 21: IF NOT(mysql_real_connect(db, '<IPAddress>', 'root', ',<password>', 'mysql', 0, NUL, 0)) THEN PRINT 'Failed to connect to database: Error: ', mysql_error$(db) Memory fault(coredump)
When I try to connect with the mysql client this works perfectly fine!
Development workstation: CentOS 8 (CentOS Linux release 8.3.2011) BaCon version: 4.3.1 on Linux x86_64 GCC version: 8.3.1 20191121 (Red Hat 8.3.1-5) (GCC) MariaDB client libs: mariadb-common-10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64 mariadb-devel-10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64 mariadb-connector-c-config-3.1.11-2.el8_3.noarch mariadb-10.3.27-3.module_el8.3.0+599+c587b2e7.x86_64 mariadb-connector-c-devel-3.1.11-2.el8_3.x86_64 mariadb-connector-c-3.1.11-2.el8_3.x86_64
|
|
|
Post by xstreur on Apr 20, 2021 9:59:56 GMT 1
Even did a test with:
File 'mysql_sample.bac' line 21: IF NOT(mysql_real_connect(db, '<IPaddress>', 'root', '<password>', 'mysql', 3306, '/tmp/mysql.sock' , 0)) THEN PRINT 'Failed to connect to database: Error: ', mysql_error$(db) Memory fault(coredump)
|
|
|
Post by Pjot on Apr 20, 2021 10:07:40 GMT 1
Hi xstreur, Well, I am not suprised - the code on the BaCon webpage for MySQL is hopelessly outdated It was created in 2010, just one year after BaCon arose from the dust, and was meant to be used with the original MySQL (so not MariaDB). I know the history behind MySQL and MariaDB all too well, and that they say the SQL interface is "more or less the same", but let's not get blinded by such popular remarks The way to interface with MariaDB now seems to be by using a so-called " connector", which seems to be included in the MariaDB library. So, for BaCon to reach a database in MariaDB, it requires a new implementation. I will remove the MySQL stuff from the BaCon website now, in order to avoid future misunderstandings. This leaves you to the task to connect to MariaDB. You mention that the mysql client works fine. A quick workaround is to use the EXEC$ function in BaCon to get your results. BR Peter
|
|