1. Fix a bug in copy_and_convert_field() when fetching bookmark columns.
authorHiroshi Inoue <inoue@tpf.co.jp>
Mon, 29 Oct 2007 15:04:48 +0000 (15:04 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Mon, 29 Oct 2007 15:04:48 +0000 (15:04 +0000)
   This bug could occur in case no suitable? lo type is found.
2. Improve the parse statement operation so that it detect srf in
   <from clause>.

convert.c
parse.c
version.h

index 177d8b9836c8400fa1ea48db576ae908aaaaa4de..3599fa519d5d6e28d38d8f3848da2755c4eb4fb2 100644 (file)
--- 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 5c3967acbfafbcd3f93909bf7f869b53c7271394..29ec2c88ca3cff7ceb71c06f9183b113176a3d40 100644 (file)
--- 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 == ',')
                {
index 01f46112708d717e21cc4e96f3e81d3681553662..1c3299f40b84d4b4907e8bba0c53df16a1789020 100644 (file)
--- 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