To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=89039
Issue #|89039
Summary|Support MySQL datetime arithmetic like DATE_ADD and DA
|TE_SUB with INTERVAL
Component|Database access
Version|OOo 2.4.0
Platform|All
URL|http://dev.mysql.com/doc/refman/6.0/en/date-and-time-f
|unctions.html#function_date-add
OS/Version|All
Status|UNCONFIRMED
Status whiteboard|
Keywords|
Resolution|
Issue type|DEFECT
Priority|P3
Subcomponent|none
Assigned to|dbaneedsconfirm
Reported by|vgagernm
------- Additional comments from [EMAIL PROTECTED] Mon May 5 19:41:25 +0000
2008 -------
I get error messages when I try to do MySQL date arithmetic in an SQL query.
Streps to reproduce:
1. Connect to some mysql database using the JDBC MySQL Connector (5.0.8 here)
2. Create table:
2.1. Tools / SQL
2.2. CREATE TABLE test1 (dateCol DATE NOT NULL)
2.3. Execute
2.4. Close
3. View / Refresh Tables
4. Enter some date:
4.1. Tools / SQL
4.2. INSERT INTO test1 VALUES ('2008-05-05')
4.3. Execute
4.4. Close
5. Create a new Query:
5.1. Queries
5.2. Create Query in SQL View
5.3. SELECT dateCol FROM test1
5.4. Save as test2
6. Introduce date arithmetic
6.1. SELECT dateCol, DATE_ADD(dateCol, INTERVAL 1 DAY) FROM test1
6.2. Save
=> Syntax error in SQL expression
6.3. More lists three errors:
Error 1:
SQL Status: HY000
Error code: 1000
Syntax error in SQL expression
Error 2:
SQL Status HY000
Error code: 1000
Error 3:
SQL Status: HY000
Error code: 1000
parse error, expecting `BETWEEN' or `IN' or `SQL_TOKEN_LIKE'
Executung the same command in the MySQL command line client works all right.
Executing the same command in the Java BeanShell console using the same JDBC
connector works all right.
Therefore this is neither a syntax problem nor a problem with MySQL or JDBC,
therefore it's a problem with OpenOffice.org.
Looking at the sources, it would seem that datetime_value_exp in
OOH680_m12/connectivity/source/parse/sqlbison.y should be modified to accept
this kind of expression, either the whole DATE_ADD etc., or three words, the
first of them being INTERVAL. There are some comments about this, but for some
reason no active code.
---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]