Bug 1546113 - RMariaDB cannot fetch data
Summary: RMariaDB cannot fetch data
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: mariadb
Version: 27
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Michal Schorm
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1544986
Blocks:
TreeView+ depends on / blocked
 
Reported: 2018-02-16 11:11 UTC by Pierre Blavy
Modified: 2023-09-14 04:16 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-11-30 22:31:31 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
test varchar (2.97 KB, text/plain)
2018-05-15 13:49 UTC, Pierre Blavy
no flags Details

Description Pierre Blavy 2018-02-16 11:11:54 UTC
Description of problem:
Hi, 
The RMariaDB package from R is unable to fetch data. This is a known bug described here : https://github.com/r-dbi/RMariaDB/issues/69

According to their report, it's due to an upstream bug in mariadb-connector-c, which is fixed in the 3.0.3 version.

Sadly the curent version is 3.0.2, so RMariaDB doesn't work.


Version-Release number of selected component (if applicable):
buggy : 3.0.2
fixed but not in repo : 3.0.3


How reproducible: always


Steps to Reproduce:
in R :
install.packages(RMariaDB);
library(RMariaDB);
db=dbConnect(RMariaDB::MariaDB(),dbname="a_database",host="localhost",user="me",password="???");

#then do a query on a NOT EMPTY table (so flushed is called), here sensor
dbSendQuery(db, "select * from sensor")

#you will see one of these messages
#message 1. I'm sure sensor IS NOT EMPTY
#<MariaDBResult>
#  SQL  select * from sensor
#  ROWS Fetched: 0 [incomplete]
#       Changed: 0

#or message 2
# Error in result_fetch(res@ptr, n) : Error fetching buffer: 



Additional info:
Bug was already discussed and fixed (see ttps://github.com/r-dbi/RMariaDB/issues/69 )
To fix it, please push version 3.0.3 of mariadb-connector-c to the fedora repo



I've tried to use the old obsolete RMySQL package as a workaround, but it was a failure. During package installation, I get the error utils.c:266:40: error: ‘MYSQL_SERVER_VERSION’ undeclared (first use in this function);

So either there is something else wrong in the mysql compatibility layer of mariadb, or something else that doesn't work.

Comment 1 Michal Schorm 2018-02-16 11:39:05 UTC
This is a little bit complicated.

Long long story short:
there were issues with connector-c in F27, so now this package is empty in F27, only requiring mariadb-devel.

All of the connector-c code is part of the 'mariadb' package.
So you are waiting for new mariadb release (10.2.13), which I'm working on, but I have some issues to investigate.

'mariadb-connector-c' will be *never* updated in F27

Comment 2 Pierre Blavy 2018-02-16 11:52:15 UTC
OK, thank for the answer.

I've tried the F28 version but it doesn't work either. Therefore what I've read in the comment on github might be wrong, or something was broken while mixing packages

Do you think that the new release will fix this bug and have an idea of when it will be available?


#--- F28 version (don't fix the bug) ---
  dnf remove mariadb mariadb-connector-c mariadb-server mariadb-devel
  dnf --disablerepo=*fusion* --nogpgcheck install mariadb mariadb-connector-c mariadb-server mariadb-devel --releasever=rawhide
  systemctl restart mariadb.service

  then reinstall RMariaDB in R

Comment 3 Pierre Blavy 2018-02-17 18:39:27 UTC
--- WORKAROUND ---

The RODBC package works correctly with mariaDB. This is not a perfect workaround as this packages doesn't have a DBI interface, so some R adaptor has to be written, but at least you can get your data in R

First install ODBC stuff, note that mysql-connector-odbc is required, if this package is missing there is no ODBC driver for mariadb in odbcinst.ini

dnf install unixODBC unixODBC-devel mariadb-connector-odbc  mysql-connector-odbc

Then configure a data source in  ~/.odbc.ini
[my_db]
Description = MariaDb database blablabla
driver   = MySQL
Database = my_db
Server   = localhost
User     = xxx
Password = xxx

Then test it in terminal
isql -v my_db

Then test it in R
install.packages("RODBC");
library("RODBC")

db = odbcConnect("farm_sensors")
db;

> sqlQuery(db,"select * from something");

Comment 4 Michal Schorm 2018-02-19 13:00:17 UTC
> Do you think that the new release will fix this bug

Yes, I think so.
Because it the source code will include connector-c 3.0.3 version code (since on the upstream the conc-c is a git submodule of the server)

> and have an idea of when it will be available?

Sorry with this one, no idea so far :(
I'm facing a strange issue and I still didn't even find the cause so far.

However, I can make some scratch build for you, and you could test it right away.
And I already have one! :)

https://koji.fedoraproject.org/koji/taskinfo?taskID=25126267

--

Please give it a try and let me know

Comment 5 Pierre Blavy 2018-02-19 16:09:26 UTC
I'm missing something but I didn't find a way to install yourt stuff without this package (neither by the following code in bash section, nor by installing all your packages). I've never used bildarch before, so maybe I'm doing something wrong

Morever, the installed version of mariadb-connector-c.3.0.2-4.fc27 is 137kb, so it's small but not empty.

Best regards (and thank a lot for your help)




#--- install in bash (OK) ---

dnf remove mariadb

dnf install \
https://kojipkgs.fedoraproject.org//work/tasks/6267/25126267/mariadb-10.2.13-1.fc27.x86_64.rpm \
https://kojipkgs.fedoraproject.org//work/tasks/6267/25126267/mariadb-common-10.2.13-1.fc27.x86_64.rpm \
https://kojipkgs.fedoraproject.org//work/tasks/6267/25126267/mariadb-devel-10.2.13-1.fc27.x86_64.rpm \
https://kojipkgs.fedoraproject.org//work/tasks/6267/25126267/mariadb-errmsg-10.2.13-1.fc27.x86_64.rpm \
https://kojipkgs.fedoraproject.org//work/tasks/6267/25126267/mariadb-server-10.2.13-1.fc27.x86_64.rpm \
https://kojipkgs.fedoraproject.org//work/tasks/6267/25126267/mariadb-config-10.2.13-1.fc27.x86_64.rpm

systemctl start mariadb.service
systemctl enable mariadb.service

/usr/bin/mysql_secure_installation

firefox http://localhost/phpmyadmin/
#==> PhpMyAdmin works, and I can see my old database.



#--- R install (OK) ---
install.packages("RMariaDB")

#--- R connect (OK) ---
drv <- RMariaDB::MariaDB()
db  <- dbConnect(drv, dbname="farm_sensors",host="127.0.0.1",port=0,user="xxx",password="xxx");
db

<MariaDBConnection>
  Host:    127.0.0.1
  Server:  10.2.13-MariaDB
  Client:  10.2.6

#--- R select (ERROR) ---
dbGetQuery(db,"select* from sensor");
Error in result_fetch(res@ptr, n) : Error fetching buffer:



#--- Details : dnf output ---
==============================================================================================================================================
 Package                                     Arch                     Version                            Repository                      Size
==============================================================================================================================================
Installing:
 mariadb                                     x86_64                   3:10.2.13-1.fc27                   @commandline                   6.2 M
 mariadb-common                              x86_64                   3:10.2.13-1.fc27                   @commandline                    57 k
 mariadb-config                              x86_64                   3:10.2.13-1.fc27                   @commandline                    39 k
 mariadb-devel                               x86_64                   3:10.2.13-1.fc27                   @commandline                   975 k
 mariadb-errmsg                              x86_64                   3:10.2.13-1.fc27                   @commandline                   226 k
 mariadb-server                              x86_64                   3:10.2.13-1.fc27                   @commandline                    17 M
Installing dependencies:
 bison                                       x86_64                   3.0.4-8.fc27                       fedora                         684 k
 keyutils-libs-devel                         x86_64                   1.5.10-3.fc27                      fedora                          46 k
 krb5-devel                                  x86_64                   1.15.2-4.fc27                      updates                        535 k
 libcom_err-devel                            x86_64                   1.43.5-2.fc27                      fedora                          35 k
 libkadm5                                    x86_64                   1.15.2-4.fc27                      updates                        179 k
 libselinux-devel                            x86_64                   2.7-3.fc27                         updates                        198 k
 libsepol-devel                              x86_64                   2.7-2.fc27                         updates                         83 k
 libverto-devel                              x86_64                   0.2.6-11.fc27                      fedora                          16 k
 mariadb-connector-c                         x86_64                   3.0.2-4.fc27                       fedora                         137 k
 mariadb-connector-c-devel                   x86_64                   3.0.2-4.fc27                       fedora                          59 k
 openssl-devel                               x86_64                   1:1.1.0g-1.fc27                    updates                        1.9 M
 pcre2-devel                                 x86_64                   10.30-6.fc27                       updates                        580 k
 pcre2-utf32                                 x86_64                   10.30-6.fc27                       updates                        208 k

Transaction Summary
==============================================================================================================================================
Install  19 Packages

Comment 6 Pierre Blavy 2018-02-19 16:17:56 UTC
PS: 
Oups, typo : the packages that were suspiciously installed were : 
mariadb-connector-c.3.0.2-4.fc27
mariadb-connector-c-devel.3.0.2-4.fc27

Comment 7 Michal Schorm 2018-02-19 16:24:42 UTC
1)
You should have 'mariadb-connector-c-3.0.2-15.fc27', that's the latest one.
*many* of the previous builds siffers from severe bugs.

You should either have the latest version or none; where the latest version is preffered, since it contains few scriplets to fix other issues, that could be made by-the-way by previous mariadb, and connector-c releases.

2)
The rest looks good to me.

I don't understand, what was the problem here. Can you please explain it more detailed? (what went wrong)

Comment 8 Pierre Blavy 2018-02-19 16:49:05 UTC
1) 
The mariadb-connector-c in the fedora repository is 3.0.2-4.fc27, so it's not the last one.

Moreover, you said the bug was fixed in 3.0.3 version but the last version of  mariadb-connector-c  is 3.0.2-15.fc27.

I didn't find 3.0.2-15.fc27 in the repository, event after enabling testing repo
according to http://cpc.cx/lk0 the 3.0.2-15 exists only for i686, but I do have a x86_64.



2) The R package was still unable to fetch data. In R when I run : 
dbGetQuery(db,"select* from sensor");

I get the error :
Error in result_fetch(res@ptr, n) : Error fetching buffer:

Which is the same bug as in my first post.

Comment 9 Pierre Blavy 2018-02-19 16:53:48 UTC
Sorry, it seems that dnf cache or the http cache at work is providing some old stuff... I'll update version after I fix this mess.

Comment 10 Michal Schorm 2018-02-19 16:57:23 UTC
I already said, mariadb-connector-c 3.0.3 for F27 is not the droid you are lookign for ;)

This version does not exist for F27 and never will.
The mariadb 10.2.13 (without any connector) should provide its full functionality.

--

On F28 (rawhide) is the situation different however.
There is connector-c 3.0.3 and it is no longer part of mariadb package.

--

So you should on f27 - ideally - update the connector-c to the latest version and drop it.
Then stick to mariadb only.

Comment 11 Pierre Blavy 2018-02-27 13:38:16 UTC
Thank for the information!

After some investigation, this bug happens only in RMariaDB package, and only when we try to bind int64 to a query, other types works well.

As the bug still exists in version 10.2.13 in windows, I suspect that this is more related to RMariaDB that to MariaDB itself.

I've reported the bug in the related R bug tracker, here. 
https://github.com/r-dbi/RMariaDB/issues/87

I'll try to provide feedback here if I get more informations that say that the problem is in MariaDB and not in RMariaDB.

And thank again for your help!

Comment 12 Michal Schorm 2018-02-27 14:01:54 UTC
OK, moving to the R-DBI package.

--

Tom,
Feel free to move it back, if you find yout it's not your issue. :)

--

Pierre,
Have you tried some "R mysql" connector?
Chances are, it could work :)

Comment 13 Tom "spot" Callaway 2018-02-27 16:31:13 UTC
RMariaDB is a separate package from R-DBI (though, they share the same upstream). So... not my bug, sorry! Hope you find a solution.

Comment 14 Pierre Blavy 2018-05-15 13:49:45 UTC
Created attachment 1436796 [details]
test varchar

Comment 15 Pierre Blavy 2018-05-15 13:50:17 UTC
Hi!
I've updated to the current MariaDB version and updated my system to fedora 28. 
MariaDB works correctly in fedora and phpMyAdmin, but RMariaDb doesn't work. It seems that there is something wrong with varchar. int, floats, and mixes works.
The full test is attached in the previous post

<MariaDBConnection>
  Host:    localhost
  Server:  10.2.14-MariaDB
  Client:  10.3.6


== TEST CODE (sql) ==
drop table if exists test_varchar;    
create table test_varchar (s1 varchar(255) );   
insert into  test_varchar (s1)values('ss');
insert into  test_varchar (s1)values(NULL);

== TEST CODE (R) ==
library("RMariaDB");
db=dbConnect(RMariaDB::MariaDB(),dbname="xxx",host="localhost",user="xxx",password="xxx");
dbGetQuery(db, "select * from test_varchar");
# ==> Error in result_fetch(res@ptr, n = n) : Error fetching buffer:

Comment 16 Michal Schorm 2018-09-18 11:54:27 UTC
Can you give me the output from the following command, please?

  $ dnf list installed | grep -e maria -e mysql

---

I'm still lost about which package it is (RMariaDB) and where did you get it. (It is from official Fedora repositories?)

Comment 17 Ben Cotton 2018-11-27 14:39:36 UTC
This message is a reminder that Fedora 27 is nearing its end of life.
On 2018-Nov-30  Fedora will stop maintaining and issuing updates for
Fedora 27. It is Fedora's policy to close all bug reports from releases
that are no longer maintained. At that time this bug will be closed as
EOL if it remains open with a Fedora  'version' of '27'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 27 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 18 Ben Cotton 2018-11-30 22:31:31 UTC
Fedora 27 changed to end-of-life (EOL) status on 2018-11-30. Fedora 27 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 19 Red Hat Bugzilla 2023-09-14 04:16:44 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days


Note You need to log in before you can comment on or make changes to this bug.