projects
/
users
/
bernd
/
postgres.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2ef6002
)
Fix test for table existance to allow mixed-case and whitespace in
author
Thomas G. Lockhart
<
[email protected]
>
Thu, 12 Nov 1998 15:34:30 +0000
(15:34 +0000)
committer
Thomas G. Lockhart
<
[email protected]
>
Thu, 12 Nov 1998 15:34:30 +0000
(15:34 +0000)
the table name. Problem reported by Billy Allie.
src/backend/catalog/heap.c
patch
|
blob
|
blame
|
history
diff --git
a/src/backend/catalog/heap.c
b/src/backend/catalog/heap.c
index a160332b232ea914a0b15f9637c2274e361afbfe..b69ca6b8d3042e2af544d1bfb53da1fd2ccd1962 100644
(file)
--- a/
src/backend/catalog/heap.c
+++ b/
src/backend/catalog/heap.c
@@
-1515,7
+1515,10
@@
StoreRelCheck(Relation rel, ConstrCheck *check)
char nulls[4] = {' ', ' ', ' ', ' '};
extern GlobalMemory CacheCxt;
- sprintf(str, "select 1 from %.*s where %s",
+ /* Check for table's existance. Surround table name with double-quotes
+ * to allow mixed-case and whitespace names. - thomas 1998-11-12
+ */
+ sprintf(str, "select 1 from \"%.*s\" where %s",
NAMEDATALEN, rel->rd_rel->relname.data, check->ccsrc);
setheapoverride(true);
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);