1) Add support for GB18030.
authorHiroshi Inoue
Tue, 25 Jun 2002 01:54:19 +0000 (01:54 +0000)
committerHiroshi Inoue
Tue, 25 Jun 2002 01:54:19 +0000 (01:54 +0000)
2) Fix a bug about the handling of large objects.

src/interfaces/odbc/execute.c
src/interfaces/odbc/multibyte.c
src/interfaces/odbc/multibyte.h

index 164debbf4d0e94e21c0cc504a9af500925247c26..598c2a2f61a5d59b7cf24dd6bc39de41987b3faf 100644 (file)
@@ -777,7 +777,7 @@ PGAPI_ParamData(
        /* commit transaction if needed */
        if (!ci->drivers.use_declarefetch && CC_is_in_autocommit(stmt->hdbc))
        {
-           if (CC_commit(stmt->hdbc))
+           if (!CC_commit(stmt->hdbc))
            {
                stmt->errormsg = "Could not commit (in-line) a transaction";
                stmt->errornumber = STMT_EXEC_ERROR;
index e7a617bb8121e60967aa96a430a34068eb2b0e25..17863a9ef5fe8c2c5dd2a3401db90203cc090c5d 100644 (file)
@@ -56,6 +56,7 @@ pg_CS CS_Table[] =
    { "GBK", GBK },
    { "UHC", UHC },
    { "WIN1250",    WIN1250 },
+   { "GB18030",    GB18030 },
    { "OTHER", OTHER }
 };
 
@@ -239,6 +240,25 @@ pg_CS_stat(int stat,unsigned int character,int characterset_code)
                    stat = 0;
            }
            break;
+           /*Chinese GB18030 support.Added by Bill Huang  */
+       case GB18030:
+           {
+               if (stat < 2 && character > 0x80)
+                   stat = 2;
+               else if (stat = 2)
+                   if (character >= 0x30 && character <= 0x39)
+                       stat = 3;
+                   else
+                       stat = 1;
+               else if (stat = 3)
+                   if (character >= 0x30 && character <= 0x39)
+                       stat = 1;
+                   else
+                       stat = 3;
+               else
+                   stat = 0;
+           }
+           break;
        default:
            {
                stat = 0;
index 47a57b0ade63f0a20f08fb6316db58e255cc751b..bd85747c0d5013cfb5ee48bf01e9f7f631954c82 100644 (file)
@@ -41,6 +41,7 @@
 #define GBK                    30  /* GBK */
 #define UHC                    31  /* UHC */
 #define WIN1250                32  /* windows-1250 */
+#define GB18030                33  /* GB18030 */
 #define OTHER              -1
 
 #define MAX_CHARACTERSET_NAME  24