Apache OpenOffice (AOO) Bugzilla – Issue 89039
Support MySQL datetime arithmetic like DATE_ADD and DATE_SUB with INTERVAL
Last modified: 2013-08-07 15:45:09 UTC
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.
reassign to oj
Set target.