hsqldb fails to properly escape column names it generates
automatically from an expression in the "script" file it uses to
recreate the database (in memory) on load/connect.

The net effect is that any .odb file where such a view has been
defined cannot be reopened, unless one manually fiddles with the
database/script file in the .odb file seen as a zip file.

This patch fixes that, by saying that *any* expression that is not
already a column name *should* be escaped (instead of *not* escaped)
when seen as a column name/alias.

I hope no bad side-effects, but I'm not intimate with HSQLDB internals,
so never can be really sure.

Please apply to libreoffice-3-5.

-- 
Lionel
>From bed3049c4c04a202ff288189d225ca6e5941d69b Mon Sep 17 00:00:00 2001
From: Lionel Elie Mamane <[email protected]>
Date: Tue, 3 Jul 2012 20:00:06 +0200
Subject: [PATCH 1/2] fdo#36824 hsqldb properly escape automatically built
 names

Change-Id: Id2c36fb24d1f7c8f8e9800c10226323594bb766e
---
 hsqldb/makefile.mk            |    3 ++-
 hsqldb/patches/fdo36824.patch |   11 +++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 hsqldb/patches/fdo36824.patch

diff --git a/hsqldb/makefile.mk b/hsqldb/makefile.mk
index e500462..3692403 100644
--- a/hsqldb/makefile.mk
+++ b/hsqldb/makefile.mk
@@ -58,7 +58,8 @@ CONVERTFILES=build$/build.xml \
 PATCH_FILES=patches$/i96823.patch \
             patches$/i97032.patch \
             patches$/i103528.patch \
-            patches$/i104901.patch
+            patches$/i104901.patch \
+            patches$/fdo36824.patch
 
 .IF "$(JAVANUMVER:s/.//)" >= "000100060000"
 PATCH_FILES+= \
diff --git a/hsqldb/patches/fdo36824.patch b/hsqldb/patches/fdo36824.patch
new file mode 100644
index 0000000..ad753e3
--- /dev/null
+++ b/hsqldb/patches/fdo36824.patch
@@ -0,0 +1,11 @@
+--- misc/hsqldb/src/org/hsqldb/Expression.java	2012-07-03 19:49:00.000000000 +0200
++++ misc/build/hsqldb/src/org/hsqldb/Expression.java	2012-07-03 19:39:00.000000000 +0200
+@@ -1552,7 +1552,7 @@
+             return columnQuoted;
+         }
+ 
+-        return false;
++        return true;
+     }
+ 
+     /**
-- 
1.7.10

_______________________________________________
LibreOffice mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to