Subject: | PATCH: Allowing long and/or starting with digit database names in connection strings |
When using GUIDs as a database name in the dsn, such as
dbi:Sybase:server=Server1;database=16AAF692-6B8E-11E2-8218-FBAC17BD48DC
DBD::Sybase truncates the database name by one character and does not
surround the database name in the use statement with double quotes,
leading to a syntax error.
This patch corrects these errors.
Subject: | dbd_sybase_use.patch |
diff -Naur old/dbdimp.c new/dbdimp.c
--- old/dbdimp.c 2011-10-03 01:56:17.000000000 +1100
+++ new/dbdimp.c 2013-02-02 12:33:17.678856093 +1100
@@ -1124,7 +1124,7 @@
if (strchr(dsn, '=')) {
extractFromDsn("server=", dsn, imp_dbh->server, 64);
extractFromDsn("charset=", dsn, imp_dbh->charset, 64);
- extractFromDsn("database=", dsn, imp_dbh->database, 36);
+ extractFromDsn("database=", dsn, imp_dbh->database, 64);
extractFromDsn("packetSize=", dsn, imp_dbh->packetSize, 64);
extractFromDsn("language=", dsn, imp_dbh->language, 64);
extractFromDsn("interfaces=", dsn, imp_dbh->ifile, 255);
@@ -1598,7 +1598,7 @@
else
db = imp_dbh->database;
- sprintf(statement, "use %s", db);
+ sprintf(statement, "use \"%s\"", db);
if (DBIc_DBISTATE(imp_dbh)->debug >= 3)
PerlIO_printf(DBIc_LOGPIO(imp_dbh),