]> granicus.if.org Git - postgresql/commitdiff
1) fix bugs reported by Andrea Aime.
authorHiroshi Inoue <inoue@tpf.co.jp>
Tue, 1 May 2001 00:47:06 +0000 (00:47 +0000)
committerHiroshi Inoue <inoue@tpf.co.jp>
Tue, 1 May 2001 00:47:06 +0000 (00:47 +0000)
2) fix a bug reported by Jan Wieck.
psqlodbc is 7.01.0005 now.

src/interfaces/odbc/parse.c
src/interfaces/odbc/psqlodbc.h
src/interfaces/odbc/psqlodbc.rc
src/interfaces/odbc/qresult.c

index 075ca95947d81dd66e014b1a0c0bffeaf071e55a..991be1cabb4ee24e26fae4e22fc324eac3bbf52d 100644 (file)
@@ -228,15 +228,21 @@ getColInfo(COL_INFO *col_info, FIELD_INFO *fi, int k)
 char
 searchColInfo(COL_INFO *col_info, FIELD_INFO *fi)
 {
-       int                     k;
-       char       *col;
+       int             k, cmp;
+       char            *col;
 
 
        for (k = 0; k < QR_get_num_tuples(col_info->result); k++)
        {
                col = QR_get_value_manual(col_info->result, k, 3);
-               if (!strcmp(col, fi->name))
+               if (fi->dquote)
+                       cmp = strcmp(col, fi->name);
+               else
+                       cmp = stricmp(col, fi->name);
+               if (!cmp)
                {
+                       if (!fi->dquote)
+                               strcpy(fi->name, col);
                        getColInfo(col_info, fi, k);
 
                        mylog("PARSE: searchColInfo: \n");
@@ -393,6 +399,9 @@ parse_statement(StatementClass *stmt)
                                {
                                        blevel--;
                                        mylog("blevel-- = %d\n", blevel);
+                               }
+                               if (blevel == 0)
+                               {
                                        if (delim == ',')
                                        {
                                                in_func = FALSE;
@@ -569,6 +578,13 @@ parse_statement(StatementClass *stmt)
                                ti[stmt->ntab]->alias[0] = '\0';
 
                                strcpy(ti[stmt->ntab]->name, token);
+                               if (!dquote)
+                               {
+                                       char *ptr;
+                                       /* lower case table name */
+                                       for (ptr = ti[stmt->ntab]->name; *ptr; ptr++)
+                                               *ptr = tolower((unsigned char) *ptr);
+                               }
                                mylog("got table = '%s'\n", ti[stmt->ntab]->name);
 
                                if (delim == ',')
index ecad03b47778703f42513d9ca63ef1169ec519be..9d39fdc7ffe341f746b7bcb20c88ae538eb5da5a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * Comments:           See "notice.txt" for copyright and license information.
  *
- * $Id: psqlodbc.h,v 1.41 2001/03/27 04:00:54 momjian Exp $
+ * $Id: psqlodbc.h,v 1.42 2001/05/01 00:47:06 inoue Exp $
  *
  */
 
@@ -42,7 +42,7 @@ typedef UInt4 Oid;
 #define DRIVERNAME                                     "PostgreSQL ODBC"
 #define DBMS_NAME                                      "PostgreSQL"
 
-#define POSTGRESDRIVERVERSION          "07.01.0004"
+#define POSTGRESDRIVERVERSION          "07.01.0005"
 
 #ifdef WIN32
 #define DRIVER_FILE_NAME                       "PSQLODBC.DLL"
index 750d32113d878c59823fdfebd04f60ee93b9e479..6f42f402da68dd0d37da4395eac0600827fc5739 100644 (file)
@@ -342,8 +342,8 @@ END
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 7,1,0,4
- PRODUCTVERSION 7,1,0,4
+ FILEVERSION 7,1,0,5
+ PRODUCTVERSION 7,1,0,5
  FILEFLAGSMASK 0x3L
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -365,14 +365,14 @@ BEGIN
             VALUE "CompanyName", "Insight Distribution Systems\0"
 #endif
             VALUE "FileDescription", "PostgreSQL Driver\0"
-            VALUE "FileVersion", " 07.01.0004\0"
+            VALUE "FileVersion", " 07.01.0005\0"
             VALUE "InternalName", "psqlodbc\0"
             VALUE "LegalCopyright", "\0"
             VALUE "LegalTrademarks", "ODBC(TM) is a trademark of Microsoft Corporation.  Microsoft® is a registered trademark of Microsoft Corporation. Windows(TM) is a trademark of Microsoft Corporation.\0"
             VALUE "OriginalFilename", "psqlodbc.dll\0"
             VALUE "PrivateBuild", "\0"
             VALUE "ProductName", "Microsoft Open Database Connectivity\0"
-            VALUE "ProductVersion", " 07.01.0004\0"
+            VALUE "ProductVersion", " 07.01.0005\0"
             VALUE "SpecialBuild", "\0"
         END
     END
index 8299b960f58dc18b9673e2b9043921255537ec2c..ac5f9e1c239a967892e56dc06ee698e03183567b 100644 (file)
@@ -330,7 +330,7 @@ QR_close(QResultClass *self)
                QR_Destructor(res);
 
                /* End the transaction if there are no cursors left on this conn */
-               if (CC_cursor_count(self->conn) == 0)
+               if (CC_is_in_autocommit(self->conn) && CC_cursor_count(self->conn) == 0)
                {
                        mylog("QResult: END transaction on conn=%u\n", self->conn);