mirror of
https://github.com/postgres/postgres.git
synced 2025-07-12 21:01:52 +03:00
Fix test for table existance to allow mixed-case and whitespace in
the table name. Problem reported by Billy Allie.
This commit is contained in:
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.64 1998/09/01 04:27:29 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/catalog/heap.c,v 1.64.2.1 1998/11/12 15:34:30 thomas Exp $
|
||||||
*
|
*
|
||||||
* INTERFACE ROUTINES
|
* INTERFACE ROUTINES
|
||||||
* heap_create() - Create an uncataloged heap relation
|
* heap_create() - Create an uncataloged heap relation
|
||||||
@ -1515,7 +1515,10 @@ StoreRelCheck(Relation rel, ConstrCheck *check)
|
|||||||
char nulls[4] = {' ', ' ', ' ', ' '};
|
char nulls[4] = {' ', ' ', ' ', ' '};
|
||||||
extern GlobalMemory CacheCxt;
|
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);
|
NAMEDATALEN, rel->rd_rel->relname.data, check->ccsrc);
|
||||||
setheapoverride(true);
|
setheapoverride(true);
|
||||||
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);
|
planTree_list = (List *) pg_parse_and_plan(str, NULL, 0, &queryTree_list, None, FALSE);
|
||||||
|
Reference in New Issue
Block a user