[ODBC-53] SQL statements will be missed some parts and causes the query failed Created: 2016-09-08  Updated: 2017-03-09  Resolved: 2017-03-09

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: None
Affects Version/s: 1.0.6
Fix Version/s: 3.0.0, 2.0.13

Type: Bug Priority: Major
Reporter: Su, Jun-Ming Assignee: Lawrin Novitsky
Resolution: Done Votes: 0
Labels: None
Environment:

Windows 2008 R2 64 bits, IIS 7.5, ASP Classic
MariaDB 10.1.16



 Description   

There is a simple schema 'test', a table 'test1', a column 'test1c' for char(10).

There is one record '123' in 'test'.'test1'

use ADODB RecordSet to retrieve data.

set a = "123"
sql = "select test1c from test.test1 where test1c = '" & a & "';"
rs = conn.execute(sql)

it will produce the error 'near testc = '123 error'

and if I debug for this problem by use response.write, the strange output occurs.

set a = "123"
sql = "select test1c from test.test1 where test1c = '" & a & "';"
response.write sql
rs = conn.execute(sql)

the result is

select test1c from test.tesmt1 where test1c = '123
(the following is error message for lacking the last part of sql statements)

once I add response.end after response.write sql, the result is the same.

set a = "123"
sql = "select test1c from test.test1 where test1c = '" & a & "';"
response.write sql
response.end
rs = conn.execute(sql)

and the last time I comment out the rs, and sql statements will be fine.

set a ="'123"
sql = "select test1c from test.test1 where test1c = '" & a & "';"
response.write sql
response.end
//rs = conn.execute(sql)

select test1c from test.test1 where tect1c = '123';

why is the rs affect the sql statements?



 Comments   
Comment by Lawrin Novitsky [ 2017-03-09 ]

I could not repeat the bug with current repo version and with 2.0.13, I assume it has been fixed already

Generated at Thu Feb 08 03:25:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.