*
- * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.69.2.3 2010/02/03 23:01:34 joe Exp $
+ * $PostgreSQL: pgsql/contrib/dblink/dblink.c,v 1.69.2.4 2010/06/03 09:41:26 itagaki Exp $
* Copyright (c) 2001-2008, PostgreSQL Global Development Group
* ALL RIGHTS RESERVED;
*
#include "nodes/nodes.h"
#include "nodes/pg_list.h"
#include "parser/parse_type.h"
+#include "parser/scansup.h"
#include "tcop/tcopprot.h"
#include "utils/acl.h"
#include "utils/array.h"
getConnectionByName(const char *name)
{
remoteConnHashEnt *hentry;
- char key[NAMEDATALEN];
+ char *key;
if (!remoteConnHash)
remoteConnHash = createConnHash();
- MemSet(key, 0, NAMEDATALEN);
- snprintf(key, NAMEDATALEN - 1, "%s", name);
+ key = pstrdup(name);
+ truncate_identifier(key, strlen(key), true);
hentry = (remoteConnHashEnt *) hash_search(remoteConnHash,
key, HASH_FIND, NULL);
{
remoteConnHashEnt *hentry;
bool found;
- char key[NAMEDATALEN];
+ char *key;
if (!remoteConnHash)
remoteConnHash = createConnHash();
- MemSet(key, 0, NAMEDATALEN);
- snprintf(key, NAMEDATALEN - 1, "%s", name);
+ key = pstrdup(name);
+ truncate_identifier(key, strlen(key), true);
hentry = (remoteConnHashEnt *) hash_search(remoteConnHash, key,
HASH_ENTER, &found);
{
remoteConnHashEnt *hentry;
bool found;
- char key[NAMEDATALEN];
+ char *key;
if (!remoteConnHash)
remoteConnHash = createConnHash();
- MemSet(key, 0, NAMEDATALEN);
- snprintf(key, NAMEDATALEN - 1, "%s", name);
-
+ key = pstrdup(name);
+ truncate_identifier(key, strlen(key), true);
hentry = (remoteConnHashEnt *) hash_search(remoteConnHash,
key, HASH_REMOVE, &found);