Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Attached patches fix two SQL parser bugs:

fdo#46206 - SQL: INSERT accepts only VALUES, not arbitrary SELECT query
fdo#46198 - SQL: NULL not accepted in place of column name in SELECT statement

(And might gain us a LibO user as a "transferee" from OpenOffice, see
 http://stackoverflow.com/questions/4770466/sql-dialect-in-openoffice-base)


Please apply both to libreoffice-3-5. I haven't tested 3.4 in any way,
if you feel like it (and the affected code looks unchanged), you can
use your own judgement.


-- 
Lionel
From 805ba42c2e8d55564c1888bcb7aa7d0b96b0095b Mon Sep 17 00:00:00 2001
From: Lionel Elie Mamane <lionel@mamane.lu>
Date: Fri, 17 Feb 2012 07:03:52 +0100
Subject: [PATCH 1/2] fdo#46198: NULL is a perfectly fine general_value

---
 connectivity/source/parse/sqlbison.y |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index d77fb14..4b85d65 100755
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -1830,7 +1830,7 @@ unsigned_value_spec:
 general_value_spec:
                parameter
        | SQL_TOKEN_USER
-       /*        | SQL_TOKEN_NULL*/
+       | SQL_TOKEN_NULL
        | SQL_TOKEN_FALSE
        | SQL_TOKEN_TRUE
        | SQL_TOKEN_VALUE
@@ -4046,7 +4046,6 @@ else_clause:
        ;
 result:
                result_expression
-       |       SQL_TOKEN_NULL
        ;
 result_expression:
        value_exp
-- 
1.7.7.3

From 8923f267dfeabdd4bc47e0b7122c45826332d455 Mon Sep 17 00:00:00 2001
From: Lionel Elie Mamane <lionel@mamane.lu>
Date: Fri, 17 Feb 2012 07:26:29 +0100
Subject: [PATCH 2/2] fdo#46206 accept an arbitrary query for INSERT

---
 connectivity/source/parse/sqlbison.y |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/connectivity/source/parse/sqlbison.y b/connectivity/source/parse/sqlbison.y
index 4b85d65..c9d92a9 100755
--- a/connectivity/source/parse/sqlbison.y
+++ b/connectivity/source/parse/sqlbison.y
@@ -770,7 +770,7 @@ fetch_statement:
        ;
 
 insert_statement:
-               SQL_TOKEN_INSERT SQL_TOKEN_INTO table_node opt_column_commalist values_or_query_spec
+               SQL_TOKEN_INSERT SQL_TOKEN_INTO table_node opt_column_commalist query_exp
                        {$$ = SQL_NEW_RULE;
                        $$->append($1);
                        $$->append($2);
-- 
1.7.7.3


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.