summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Kreen2009-04-09 09:25:09 +0000
committerMarko Kreen2009-04-13 13:11:55 +0000
commit48f8ba60de975b17022096814eb8d8173eccc07a (patch)
tree2a7921209aa91ee1a3ab2f0fb0fab0aa86bef788
parent3e66365635e9d58e1902b17adfaa7bbf7bc3ba7d (diff)
Import fixes from 2.1-stable.
- make skytools pkg depend on rsync - missing headers in Postgres modules - quoting for numeric ident
-rw-r--r--debian/packages.in2
-rw-r--r--python/skytools/quoting.py2
-rw-r--r--sql/logtriga/logtriga.c1
-rw-r--r--sql/pgq/triggers/common.c2
-rwxr-xr-xtests/quoting/regtest.py10
5 files changed, 14 insertions, 3 deletions
diff --git a/debian/packages.in b/debian/packages.in
index c262f47a..ec6ad58d 100644
--- a/debian/packages.in
+++ b/debian/packages.in
@@ -20,7 +20,7 @@ Build-Depends: python-dev, postgresql-server-dev-PGVER, xmlto, asciidoc (>= 8.2)
Package: skytools
Architecture: any
-Depends: python-psycopg2 | pythonPYVER-psycopg2, skytools-modules-8.4 | skytools-modules-8.3 | skytools-modules-8.2, []
+Depends: python-psycopg2 | pythonPYVER-psycopg2, skytools-modules-8.4 | skytools-modules-8.3 | skytools-modules-8.2, rsync, []
Description: Skype database tools - Python parts
.
londiste - replication
diff --git a/python/skytools/quoting.py b/python/skytools/quoting.py
index 9d281254..ce860040 100644
--- a/python/skytools/quoting.py
+++ b/python/skytools/quoting.py
@@ -66,7 +66,7 @@ _ident_kwmap = {
"errors":1,
}
-_ident_bad = re.compile(r"[^a-z0-9_]")
+_ident_bad = re.compile(r"[^a-z0-9_]|^[0-9]")
def quote_ident(s):
"""Quote SQL identifier.
diff --git a/sql/logtriga/logtriga.c b/sql/logtriga/logtriga.c
index 9a88d6bf..427d3ade 100644
--- a/sql/logtriga/logtriga.c
+++ b/sql/logtriga/logtriga.c
@@ -17,6 +17,7 @@
#include "executor/spi.h"
#include "commands/trigger.h"
#include "catalog/pg_operator.h"
+#include "catalog/pg_type.h"
#include "utils/typcache.h"
#include "textbuf.h"
diff --git a/sql/pgq/triggers/common.c b/sql/pgq/triggers/common.c
index ed5d9535..a1a95077 100644
--- a/sql/pgq/triggers/common.c
+++ b/sql/pgq/triggers/common.c
@@ -23,12 +23,12 @@
#include <catalog/pg_namespace.h>
#include <executor/spi.h>
#include <lib/stringinfo.h>
+#include <utils/builtins.h>
#include <utils/memutils.h>
#include <utils/inval.h>
#include <utils/hsearch.h>
#include <utils/syscache.h>
#include <utils/builtins.h>
-
#include "common.h"
#include "stringutil.h"
diff --git a/tests/quoting/regtest.py b/tests/quoting/regtest.py
index bbe85c74..58d9b7a7 100755
--- a/tests/quoting/regtest.py
+++ b/tests/quoting/regtest.py
@@ -61,6 +61,16 @@ sql_bytea_raw = [
regtest("quote_bytea_raw/c", skytools._cquoting.quote_bytea_raw, sql_bytea_raw)
regtest("quote_bytea_raw/py", skytools._pyquoting.quote_bytea_raw, sql_bytea_raw)
+sql_ident = [
+ ["", ""],
+ ["a'\t\\\"b", '"a\'\t\\""b"'],
+ ['abc_19', 'abc_19'],
+ ['from', '"from"'],
+ ['0foo', '"0foo"'],
+ ['mixCase', '"mixCase"'],
+]
+regtest("quote_ident", skytools.quote_ident, sql_ident)
+
t_urlenc = [
[{}, ""],
[{'a': 1}, "a=1"],