[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gambas-bugtracker] Bug #3001: db2 insert sql generation


http://gambaswiki.org/bugtracker/edit?object=BUG.3001&from=L21haW4-

bruce B reported a new bug.

Summary
-------

db2 insert sql generation

Type             : Bug
Priority         : High
Gambas version   : 3.20
Product          : Database component


Description
-----------

At least for postgres.
When the DB2 component generates an Insert request it does not quote the column names. If one of the columns is a reserved word then an invalid request occurs.
For example,  I have a table in which one of the columns is named "offset" and the following code:
 rlt = Common.Conn.Create(sTable)
 Marshall(rlt) ' moves the local data into the result
 db.Debug = True
 rlt.Update   ----> Gives ERROR:  syntax error at or near "offset"

The generated SQL, from DB.Debug is 
INSERT INTO "pedestrian" ( distweight, stepsperframe, offset, image ) VALUES ( 6, 0, 21, NULL )

i.e. none of the columns are quoted, in particular offset.


System information
------------------

[System]
Gambas=3.20.2 803e6d2da (stable)
OperatingSystem=Linux
Distribution=Debian GNU/Linux 11 (bullseye)
Kernel=5.10.0-34-amd64
Architecture=x86_64
Cores=16
Memory=5852M
Language=en_AU.UTF-8
Platform=x11
Desktop=XFCE
DesktopResolution=96
DesktopScale=9
WidgetTheme=proxy
Font=Liberation Sans,12
DarkTheme=False
[Programs]
dpkg=Debian 'dpkg' package management program version 1.20.13 (amd64).
gcc=gcc (Debian 10.2.1-6) 10.2.1 20210110
git=git version 2.30.2
msgmerge=msgmerge (GNU gettext-tools) 0.21
rpmbuild=RPM version 4.16.1.2
trans=Translate Shell       0.9.6.12
[Libraries]
Cairo=libcairo.so.2.11600.0
Curl=libcurl.so.4.7.0
DBus=libdbus-1.so.3.19.17
GDK2=libgdk-x11-2.0.so.0.2400.33
GDK3=libgdk-3.so.0.2404.20
GStreamer=libgstreamer-1.0.so.0.1804.0
GTK+2=libgtk-x11-2.0.so.0.2400.33
GTK+3=libgtk-3.so.0.2404.20
OpenGL=libGL.so.1.7.0
Poppler=libpoppler.so.102.0.0
QT5=libQt5Core.so.5.15.2
QT6=libQt6Core.so.6.4.2
RSvg=librsvg-2.so.2.47.0
SDL=libSDL2-2.0.so.0.2600.4
SQLite3=libsqlite3.so.0.8.6
[Environment]
DBUS_SESSION_BUS_ADDRESS=unix:path=/tmp/dbus-rOlbBmDteD,guid=eae5fb61daaba9efa762656b67d7576d
DESKTOP_SESSION=xfce
DISPLAY=:0.0
EDITOR=geany
GB_GUI=gb.qt6
GDMSESSION=xfce
GDM_LANG=en_AU.UTF-8
GTK3_NOCSD_IGNORE=1
GTK_CSD=1
GTK_MODULES=canberra-gtk-module
HOME=<home>
LANG=en_AU.UTF-8
LANGUAGE=en_AU.UTF-8
LOGNAME=<user>
PAPERSIZE=a4
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
PWD=<home>
QT_ACCESSIBILITY=1
QT_LOGGING_RULES=*.debug=false
QT_PLATFORMTHEME=gtk2
QT_PLATFORM_PLUGIN=gtk2
QT_QPA_PLATFORMTHEME=gtk2
QT_SCALE_FACTOR=1
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/3223,unix/<hostname>:/tmp/.ICE-unix/3223,inet6/<hostname>:34961,inet/<hostname>:34403
SHELL=/bin/bash
SSH_AGENT_PID=3304
SSH_AUTH_SOCK=/tmp/ssh-1gK6OktJ0KWl/agent.3223
TZ=:/etc/localtime
USER=<user>
XAUTHORITY=<home>/.Xauthority
XDG_CONFIG_DIRS=/etc/xdg
XDG_CURRENT_DESKTOP=XFCE
XDG_DATA_DIRS=/usr/share/xfce4:<home>/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share:/usr/share
XDG_GREETER_DATA_DIR=/var/lib/lightdm/data/<user>
XDG_MENU_PREFIX=xfce-
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=xfce
XDG_SESSION_ID=1
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session0
XDG_SESSION_TYPE=x11
XDG_VTNR=7


----[ Gambas bugtracker-list is hosted by https://www.hostsharing.net ]----