[Gambas-user] Issue 632 in gambas: Unable to retrive blob data from MySQL

gambas at ...2524... gambas at ...2524...
Fri Aug 7 10:26:52 CEST 2015


Status: New
Owner: ----
Labels: Version3.8 Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 632 by isaf... at ...626...: Unable to retrive blob data from MySQL
https://code.google.com/p/gambas/issues/detail?id=632


1) Unable to retrive blob data from MySQL in version 3.8. However it was  
working well in version 3.7.1

2) [System]
Gambas=3.8.0
OperatingSystem=Linux
Kernel=3.16.0-45-generic
Architecture=x86
Distribution=Ubuntu 14.04.3 LTS
Desktop=GNOME
Theme=Gtk
Language=en_US.UTF-8
Memory=1948M
[Libraries]
Cairo=libcairo.so.2.11301.0
Curl=libcurl.so.4.3.0
DBus=libdbus-1.so.3.7.6
GStreamer=libgstreamer-0.10.so.0.30.0
GStreamer=libgstreamer-1.0.so.0.204.0
GTK+3=libgtk-3.so.0.1000.8
GTK+=libgtk-x11-2.0.so.0.2400.23
OpenGL=libGL.so.1.2.0
Poppler=libpoppler.so.44.0.0
Qt4=libQtCore.so.4.8.6
Qt5=libQt5Core.so.5.2.1
SDL=libSDL-1.2.so.0.11.4
[Environment]
CLUTTER_IM_MODULE=xim
COMPIZ_BIN_PATH=/usr/bin/
COMPIZ_CONFIG_PROFILE=ubuntu
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ACXg2O8PxE
DEFAULTS_PATH=/usr/share/gconf/ubuntu.default.path
DESKTOP_SESSION=ubuntu
DISPLAY=:0
GB_GUI=gb.qt4
GDMSESSION=ubuntu
GDM_LANG=en_US
GIO_LAUNCHED_DESKTOP_FILE=/usr/share/applications/gambas3.desktop
GIO_LAUNCHED_DESKTOP_FILE_PID=6895
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_KEYRING_CONTROL=/run/user/1000/keyring-kGuAZu
GNOME_KEYRING_PID=2183
GPG_AGENT_INFO=/run/user/1000/keyring-kGuAZu/gpg:0:1
GTK_IM_MODULE=ibus
GTK_MODULES=overlay-scrollbar:unity-gtk-module
HOME=/home/safiur
IM_CONFIG_PHASE=1
INSTANCE=
JOB=dbus
LANG=en_US.UTF-8
LANGUAGE=en_US
LC_ADDRESS=ne_NP
LC_IDENTIFICATION=ne_NP
LC_MEASUREMENT=ne_NP
LC_MONETARY=ne_NP
LC_NAME=ne_NP
LC_NUMERIC=ne_NP
LC_PAPER=ne_NP
LC_TELEPHONE=ne_NP
LC_TIME=ne_NP
LOGNAME=safiur
MANDATORY_PATH=/usr/share/gconf/ubuntu.mandatory.path
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
PWD=/home/safiur
QT4_IM_MODULE=xim
QT_IM_MODULE=ibus
QT_QPA_PLATFORMTHEME=appmenu-qt5
SELINUX_INIT=YES
SESSION=ubuntu
SESSIONTYPE=gnome-session
SESSION_MANAGER=local/safiur-HP-Compaq:@/tmp/.ICE-unix/2387,unix/safiur-HP-Compaq:/tmp/.ICE-unix/2387
SHELL=/bin/bash
SHLVL=0
SSH_AUTH_SOCK=/run/user/1000/keyring-kGuAZu/ssh
TEXTDOMAIN=im-config
TEXTDOMAINDIR=/usr/share/locale/
TZ=:/etc/localtime
UPSTART_SESSION=unix:abstract=/com/ubuntu/upstart-session/1000/2186
USER=safiur
XAUTHORITY=/home/safiur/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg/xdg-ubuntu:/usr/share/upstart/xdg:/etc/xdg
XDG_CURRENT_DESKTOP=Unity
XDG_DATA_DIRS=/usr/share/ubuntu:/usr/share/gnome:/usr/local/share/:/usr/share/
XDG_GREETER_DATA_DIR=/var/lib/lightdm-data/safiur
XDG_MENU_PREFIX=gnome-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_ID=c2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_VTNR=7
XMODIFIERS=@im=ibus

3) I use gambas method to create a table with blob field in MySQL table.
     Dim hTable As Table

     hTable = $newCon.Tables.Add("tblimage")
     hTable.Fields.Add("fldid", db.Serial)
     hTable.Fields.Add("fldpic", db.Blob)
     hTable.PrimaryKey = ["fldid"]
     hTable.Update

I use gambas method to insert image file in the above table.
   Dim res As Result

   res = $newCon.Create("tblimage")
   res["fldpic"] = File.Load("/home/safiur/picture.png")
   res.Update

I use gambas method to retrive the image file from database and load onto  
ImageViewer.
     Dim res As Result
     Dim tempFile As String
     Dim hFile As Blob

     res = $newCon.Exec("select fldpic from tblimage")
     res.MoveFirst
     tempFile = Temp() & ".png"
     hFile = res["fldpic"]
     File.Save(tempFile, hFile.Data)
     ImageView1.Image = Image.Load(tempFile)

-insert image works well.
-retriving image is not working.

4) Attached

5) If your project needs a database, try to provide it, or part of it.

6) Explain clearly how to reproduce the bug or the crash.

  ____________________________________________________________
/                                                            \
| IMPORTANT NOTE #3                                          |
|                                                            |
| By doing that carefully, you have done 50% of the bug fix  |
| job. Often even more!                                      |
\____________________________________________________________/
  ____________________________________________________________
/                                                            \
| IMPORTANT NOTE #4                                          |
|                                                            |
| Google automatically replaces references to Gambas         |
| development revision with links to its own source code     |
| repository, which Gambas does not use at all. So ignore    |
| these links with disdain.                                  |
\____________________________________________________________/






Attachments:
	imagedatabase.tar.gz  5.1 KB

-- 
You received this message because this project is configured to send all  
issue notifications to this address.
You may adjust your notification preferences at:
https://code.google.com/hosting/settings




More information about the User mailing list