[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mysql-odbc
Subject:    bk commit - MyODBC 3.51
From:       venu () mysql ! com
Date:       2002-10-23 20:05:11
[Download RAW message or body]

Below is the list of changes that have just been commited into a local
MyODBC 3.51 repository of 'venu'. When 'venu' does a push, they will
be propogaged to the main repository and within 24 hours after the push
into the public repository. 

For more information on how to access the public repository see
http://www.mysql.com/products/myodbc/faq.html#Development_source

ChangeSet
  1.230 02/10/23 11:57:07 venu@myvenu.com +2 -0
  Added missed SQLSTATE conversions

  error.h
    1.16 02/10/23 11:56:46 venu@myvenu.com +10 -1

  error.c
    1.30 02/10/23 11:56:40 venu@myvenu.com +40 -8	

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: venu
# Host: work.mysql.com
# Root: /home/bk/myodbc3

--- 1.29/error.c        Fri Sep 13 17:09:41 2002
+++ 1.30/error.c        Wed Oct 23 20:56:40 2002
@@ -91,6 +91,7 @@
   {"21S01","Column count does not match value count",-1},
   {"23000","Integrity constraint violation",-1},
   {"42000","Syntax error or access violation",-1},
+  {"42S01","Base table or view already exists ",-1},
   {"42S02","Base table or view not found",-1},
   {"42S12","Index not found",-1},
   {"42S21","Column already exists",-1},
@@ -116,6 +117,13 @@
     myodbc3_errors[i].sqlstate[0] = 'S';
     myodbc3_errors[i].sqlstate[1] = '1';
   }
+  strncpy(myodbc3_errors[MYERR_07005].sqlstate,"24000",5);
+  strncpy(myodbc3_errors[MYERR_42000].sqlstate,"37000",5);
+  strncpy(myodbc3_errors[MYERR_42S01].sqlstate,"S0001",5);
+  strncpy(myodbc3_errors[MYERR_42S02].sqlstate,"S0002",5);
+  strncpy(myodbc3_errors[MYERR_42S12].sqlstate,"S0012",5);
+  strncpy(myodbc3_errors[MYERR_42S21].sqlstate,"S0021",5);
+  strncpy(myodbc3_errors[MYERR_42S22].sqlstate,"S0022",5);
 }
 
 /*
@@ -176,17 +184,41 @@
   char *state=myodbc3_errors[errid].sqlstate;
   DBUG_ENTER("translate_error");
   switch (mysql_err) {
-  case ER_WRONG_VALUE_COUNT:    state= "21S01"; break;
+  case ER_WRONG_VALUE_COUNT:    
+    state= "21S01"; 
+    break;
   case ER_DUP_ENTRY:
-  case ER_DUP_KEY:      state= "23000"; break;
-  case ER_PARSE_ERROR:      state= "42000"; break;
+  case ER_DUP_KEY:      
+    state= "23000"; 
+    break;
+  case ER_NO_DB_ERROR:
+    state= "3D000"; 
+    break;   
+  case ER_PARSE_ERROR:      
+    state= myodbc3_errors[MYERR_42000].sqlstate; 
+    break;
+  case ER_TABLE_EXISTS_ERROR: 
+    state= myodbc3_errors[MYERR_42S01].sqlstate; 
+    break;
   case ER_FILE_NOT_FOUND:
-  case ER_CANT_OPEN_FILE:   state= "42S02"; break;
-  case ER_CANT_DROP_FIELD_OR_KEY: state= "42S12"; break;
-  case ER_DUP_FIELDNAME:    state= "42S21"; break;
-  case ER_BAD_FIELD_ERROR:    state= "42S22"; break;
+  case ER_NO_SUCH_TABLE:
+  case ER_CANT_OPEN_FILE:   
+    state= myodbc3_errors[MYERR_42S02].sqlstate; 
+    break;
+  case ER_NO_SUCH_INDEX:
+  case ER_CANT_DROP_FIELD_OR_KEY: 
+    state= myodbc3_errors[MYERR_42S12].sqlstate; 
+    break;
+  case ER_DUP_FIELDNAME:    
+    state= myodbc3_errors[MYERR_42S21].sqlstate; 
+    break;
+  case ER_BAD_FIELD_ERROR:    
+    state= myodbc3_errors[MYERR_42S22].sqlstate; 
+    break;
   case CR_SERVER_HANDSHAKE_ERR:
-  case CR_CONNECTION_ERROR:   state= "08S01"; break;
+  case CR_CONNECTION_ERROR:   
+    state= "08S01"; 
+    break;
   default: break;
   }
   strmov(save_state,state);

--- 1.15/error.h        Thu Sep 12 21:39:24 2002
+++ 1.16/error.h        Wed Oct 23 20:56:46 2002
@@ -99,7 +99,16 @@
     MYERR_S1106,
     MYERR_S1107,
     MYERR_S1109,
-    MYERR_S1C00
+    MYERR_S1C00,
+    MYERR_21S01,
+    MYERR_23000,
+    MYERR_42000,
+    MYERR_42S01,
+    MYERR_42S02,
+    MYERR_42S12,
+    MYERR_42S21,
+    MYERR_42S22,
+    MYERR_08S01,
 
 } myodbc_errid;
 



---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/products/myodbc/manual_toc.html (the manual)
   http://lists.mysql.com/                        (the list archive)

To request this thread, e-mail <myodbc-thread6334@lists.mysql.com>
To unsubscribe, e-mail <myodbc-unsubscribe-##L=##H@lists.mysql.com>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic