Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.0.16
Description
CONNECT doesn't put quotes around DATETIME values returned from local functions.
For example, consider the now() function:
MariaDB [tmp]> SELECT * From datetime_table where modifiedon > now();
|
ERROR 1296 (HY000): Got error 174 '[FreeTDS][SQL Server]Incorrect syntax near '16'.' from CONNECT
|
|
MariaDB [tmp]> SELECT NOW();
|
+---------------------+
|
| NOW() |
|
+---------------------+
|
| 2015-02-05 16:22:39 |
|
+---------------------+
|
1 row in set (0.00 sec)
|
|
MariaDB [tmp]> SELECT * From datetime_table where modifiedon > '2015-02-05 16:22:39';
|
+----+---------------------+
|
| id | modifiedon |
|
+----+---------------------+
|
| 2 | 2016-01-01 00:00:00 |
|
+----+---------------------+
|
1 row in set (0.45 sec)
|
The ODBC trace log shows:
[ODBC][14801][1423171100.511886][SQLExecDirect.c][240]
|
Entry:
|
Statement = 0x7f8aa868d600
|
SQL = [SELECT id, modifiedon FROM dbo.datetime_table WHERE modifiedon > 2015-02-05 16:18:20][length = 84 (SQL_NTS)]
|
There should be quotes around the DATETIME value in the query sent to the remote server.