From 569b9cf9215dc21a5ae26ff4762e9cfad59dbe35 Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Mon, 29 Oct 2007 15:04:48 +0000 Subject: [PATCH] 1. Fix a bug in copy_and_convert_field() when fetching bookmark columns. This bug could occur in case no suitable? lo type is found. 2. Improve the parse statement operation so that it detect srf in . --- convert.c | 3 +++ parse.c | 21 ++++++++++++++++++--- version.h | 2 +- 3 files changed, 22 insertions(+), 4 deletions(-) diff --git a/convert.c b/convert.c index 177d8b9..3599fa5 100644 --- a/convert.c +++ b/convert.c @@ -778,6 +778,9 @@ inolog("2stime fr=%d\n", std_time.fr); return convert_lo(stmt, value, fCType, rgbValueBindRow, cbValueMax, pcbValueBindRow); + case 0: + break; + default: if (field_type == stmt->hdbc->lobj_type /* hack until permanent type available */ diff --git a/parse.c b/parse.c index 5c3967a..29ec2c8 100644 --- a/parse.c +++ b/parse.c @@ -1194,7 +1194,7 @@ parse_statement(StatementClass *stmt, BOOL check_hasoids) else if (token[0] == '(') { blevel++; - mylog("blevel++ = %d\n", blevel); + mylog("blevel++ -> %d\n", blevel); /* aggregate function ? */ if (stoken[0] && updatable && 0 == subqlevel) { @@ -1434,6 +1434,8 @@ parse_statement(StatementClass *stmt, BOOL check_hasoids) } if (out_table && !in_table) /* new table */ { + BOOL is_table_name; + in_dot = FALSE; maybe_join = 0; if (!dquote) @@ -1451,17 +1453,30 @@ parse_statement(StatementClass *stmt, BOOL check_hasoids) ti = stmt->ti; wti = ti[stmt->ntab - 1]; - if (dquote || stricmp(token, "select")) + is_table_name = TRUE; + if (dquote) + ; + else if (0 == stricmp(token, "select")) + { + mylog("got subquery lvl=%d\n", blevel); + is_table_name = FALSE; + } + else if ('(' == ptr[0]) + { + mylog("got srf? = '%s'\n", token); + is_table_name = FALSE; + } + if (is_table_name) { STR_TO_NAME(wti->table_name, token); lower_the_name(GET_NAME(wti->table_name), conn, dquote); + mylog("got table = '%s'\n", PRINT_NAME(wti->table_name)); } else { NULL_THE_NAME(wti->table_name); TI_no_updatable(wti); } - mylog("got table = '%s'\n", PRINT_NAME(wti->table_name)); if (0 == blevel && delim == ',') { diff --git a/version.h b/version.h index 01f4611..1c3299f 100644 --- a/version.h +++ b/version.h @@ -12,6 +12,6 @@ #define POSTGRESDRIVERVERSION "08.02.0501" #define POSTGRES_RESOURCE_VERSION "08.02.0501\0" #define PG_DRVFILE_VERSION 8,2,05,01 -#define PG_BUILD_VERSION "200710280001" +#define PG_BUILD_VERSION "200710290001" #endif -- 2.39.5