Details
-
Bug
-
Resolution: Duplicate
-
P3: Somewhat important
-
4.5.3
-
None
-
Qt 4.5.3 with mingw on Windows XP. database is Microsoft SQL Server 2005
Description
if i have query which has same parameter used twice, for example:
insert into sometable(col1,col2,col3) values (:param1,:param1,:param1)
then it behaves incorrectly with at least microsoft sql 2000 database using odbc connection
what happens is that while preparing statement it prepares vector with 0 values and index with one parameter, however, position of this parameter will be 3 (first two occurences will be lost)
when i do bindValue(name,value) then value is set for this lats used position only, previous positions will remain undefined
result is that when query is executed qt tries to process all parameters and launched query crashes on first such parameter - because of uninitialized value it tries to send value as binary and microsoft dastabase returns error because it can't convert varbin to text (or whatever else should be in this field)
Attachments
For Gerrit Dashboard: QTBUG-6420 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
21467,6 | Allow named bind values to be used multiple times per query | master | qt/qtbase | Status: MERGED | +2 | 0 |
48397,1 | Allow named bind values to be used multiple times per query | 4.8 | qt/qt | Status: ABANDONED | -2 | 0 |