Skip to content

Commit b35f997

Browse files
committed
Fix MDEV-8882
modified: storage/connect/tabodbc.cpp
1 parent d51e466 commit b35f997

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

storage/connect/tabodbc.cpp

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,21 @@ PSZ TDBODBC::GetFile(PGLOBAL g)
321321
{
322322
if (Connect) {
323323
char *p1, *p2;
324-
size_t n;
324+
int i;
325+
size_t n;
325326

326-
if ((p1 = strstr(Connect, "DBQ="))) {
327-
p1 += 4; // Beginning of file name
327+
if (!(p1 = strstr(Connect, "DBQ="))) {
328+
char *p, *lc = strlwr(PlugDup(g, Connect));
329+
330+
if ((p = strstr(lc, "database=")))
331+
p1 = Connect + (p - lc);
332+
333+
i = 9;
334+
} else
335+
i = 4;
336+
337+
if (p1) {
338+
p1 += i; // Beginning of file name
328339
p2 = strchr(p1, ';'); // End of file path/name
329340

330341
// Make the File path/name from the connect string

0 commit comments

Comments
 (0)