[MDEV-7549] CONNECT doesn't put quotes around DATETIME values returned from local functions Created: 2015-02-05 Updated: 2015-02-09 Resolved: 2015-02-09 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - Connect |
| Affects Version/s: | 10.0.16 |
| Fix Version/s: | 10.0.17 |
| Type: | Bug | Priority: | Major |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Olivier Bertrand |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | connect-engine | ||
| Description |
|
CONNECT doesn't put quotes around DATETIME values returned from local functions. For example, consider the now() function:
The ODBC trace log shows:
There should be quotes around the DATETIME value in the query sent to the remote server. |
| Comments |
| Comment by Olivier Bertrand [ 2015-02-09 ] | ||
|
As a matter of facts, this is more than simply puting quotes around date values. The issue is that the syntax for placing dates in SQL statements varies from data sources to data sources. for instance:
fails with MS Access because Access put '#' around dates. But you cannot ask the query as:
Because it is firstly parsed by MariaDB and produces a syntax error. Fortunately, ODBC provides escape sequences to represent temporal values and what CONNECT does is trying as much as possible to replace temporal values by these escape sequences. Also remember the SRCDEF and EXECSRC ODBC table types that CONNECT features. They permit sending queries and commands using the data source syntax and can be used when the CONNECT fails to provide the correct replacement. This can happen in unfrequent cases such as complex where clauses or when the temporal values are not in the where clause. Note that this fixes also most of INSERT and DELETE statements. INSERT does not require this fix because values are sent directly, using a prepared statement. |