PxPlus User Forum

Twitter Twitter Twitter

Author Topic: accessing mySQL-DB  (Read 1545 times)

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 179
    • View Profile
accessing mySQL-DB
« on: March 13, 2024, 11:19:19 AM »
We encounter problems with a newer version of libmariadb.so.3
PxPlus 20.10 is installed on a Linux server.
The program below runs with version 3.1.13 on a Linux server. With version 3.2.7 the result is empty and msg(-1) returns "MYSQL:0:".
Code: [Select]
begin
dbOpt$ = "SERVER=my_server;USER=my_account;PASSWORD=my_password;DATETIME_CONVERT=N"
dbName$ = "[MYSQL]my_database;;"
channel = hfn
open (channel, OPT = dbOpt$, tim = 10) dbName$
query$ = "SELECT * FROM `myTable` limit 1"
write record (channel)query$
gosub buildPVXIOList
repeat
read record(channel,err=*next)sqlResultItem$
if tcb(2) {
print msg(err)
print msg(-1)
break
}
print ++c,": ",sqlResultItem$
until 0
close( channel)
end
buildPVXIOList:
local sqlIOL$    = ken(channel, ind = 3)
local pvxIOL$    = "IOLIST "
local separator$ = $$
local items      = pos(";" = sqlIOL$, 1, 0)
local counter    = 0
local virtual    = 0
repeat
fieldDefinition$ = arg(sqlIOL$, counter + 1, ";")
read data from fieldDefinition$, sep = "," to fieldName$, fieldType$
fieldName$  = tbl(nul(fieldName$), fieldName$, "_VIRTUAL" + str(++virtual))
pvxIOL$    += separator$ + fieldName$
if (mid(fieldType$, 1, 3) = "CHR") or (fieldType$ = "DATE") {
pvxIOL$ += "$"
}
separator$ = ","
until (++counter > items)
pvxIOL$ = sub(pvxIOL$, "-", "_")
dim sqlResultItem$ : cpl(pvxIOL$)
return

What needs to be done in order to work with then newer version?

EVa

  • Gold Member
  • ****
  • Posts: 55
    • View Profile
    • EDIAS
Re: accessing mySQL-DB
« Reply #1 on: March 13, 2024, 11:57:13 AM »
I'm running CentOS8, my MariaDB library version is:

libmariadb.so.3-3.1.11-2.el8_3.x86_64

Your program codes works without an error in v20.10 (64-bit).

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 179
    • View Profile
Re: accessing mySQL-DB
« Reply #2 on: March 14, 2024, 02:52:19 AM »
That's what I'm saying.
But the issue comes with version 3.2.7.

EVa

  • Gold Member
  • ****
  • Posts: 55
    • View Profile
    • EDIAS
Re: accessing mySQL-DB
« Reply #3 on: March 14, 2024, 04:53:23 AM »
Can you tell me the Linux version that you are using (I assume it's the 64-bit version of both the OS and PxPlus) ?

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 179
    • View Profile
Re: accessing mySQL-DB
« Reply #4 on: March 18, 2024, 04:25:53 AM »
The customer uses openSUSE Leap 15.5
We use a Gentoo and can reproduce the issue

Thomas Bock

  • Diamond Member
  • *****
  • Posts: 179
    • View Profile
Re: accessing mySQL-DB
« Reply #5 on: March 25, 2024, 04:57:34 AM »
Are there any new insights?

EVa

  • Gold Member
  • ****
  • Posts: 55
    • View Profile
    • EDIAS
Re: accessing mySQL-DB
« Reply #6 on: March 26, 2024, 04:54:28 AM »
PvxPlus Technologies is looking into this.

EVa

  • Gold Member
  • ****
  • Posts: 55
    • View Profile
    • EDIAS
Re: accessing mySQL-DB
« Reply #7 on: March 26, 2024, 05:08:25 AM »
A temporary work-around is to downgrade the mariadb3 package to version 3.1.13-3.30.1 - the PxPlus MYSQL interface works correctly with that version.