Diff for /sql/odbc/parser3odbc.C between versions 1.20 and 1.22

version 1.20, 2004/03/05 09:59:58 version 1.22, 2004/05/25 07:07:28
Line 56  static char *lsplit(char *string, char d Line 56  static char *lsplit(char *string, char d
     return 0;      return 0;
 }  }
   
 static void toupper(char *out, const char *in, size_t size) {  static void toupper_str(char *out, const char *in, size_t size) {
         while(size--)          while(size--)
                 *out++=(char)toupper(*in++);                  *out++=(char)toupper(*in++);
 }  }
Line 81  public: Line 81  public:
         int api_version() { return SQL_DRIVER_API_VERSION; }          int api_version() { return SQL_DRIVER_API_VERSION; }
         const char *initialize(char *dlopen_file_spec) { return 0; }          const char *initialize(char *dlopen_file_spec) { return 0; }
         /**     connect          /**     connect
                 @param used_only_in_connect_url                  @param url
                         format: @b DSN=dsn;UID=user;PWD=password (ODBC connect string)                          format: @b DSN=dsn;UID=user;PWD=password (ODBC connect string)
                         WARNING: must be used only to connect, for buffer doesn't live long                          WARNING: must be used only to connect, for buffer doesn't live long
         */          */
         void connect(          void connect(
                 char *used_only_in_connect_url,                   char *url, 
                 SQL_Driver_services& services,                   SQL_Driver_services& services, 
                 void **connection_ref ///< output: Connection*                  void **connection_ref ///< output: Connection*
                 ) {                  ) {
Line 95  public: Line 95  public:
                 connection.services=&services;                  connection.services=&services;
                 connection.cstrClientCharset=0;                  connection.cstrClientCharset=0;
   
                 if(const char* key_start=strstr(used_only_in_connect_url, "ClientCharset=")) {                  if(const char* key_start=strstr(url, "ClientCharset=")) {
                         const char* value_start=key_start+14/*strlen("ClientCharset=")*/;                          const char* value_start=key_start+14/*strlen("ClientCharset=")*/;
                         const char* value_end=strchr(value_start, ';');                          const char* value_end=strchr(value_start, ';');
                         if(!value_end)                          if(!value_end)
                                 value_end=used_only_in_connect_url+strlen(used_only_in_connect_url);                                  value_end=url+strlen(url);
   
                         if(size_t ClientCharsetLength=value_end-value_start) {                          if(size_t ClientCharsetLength=value_end-value_start) {
                                 char* cstrClientCharset=(char*)services.malloc_atomic(ClientCharsetLength+1);                                  char* cstrClientCharset=(char*)services.malloc_atomic(ClientCharsetLength+1);
                                 toupper(cstrClientCharset, value_start, ClientCharsetLength);                                  toupper_str(cstrClientCharset, value_start, ClientCharsetLength);
                                 cstrClientCharset[ClientCharsetLength]=0;                                  cstrClientCharset[ClientCharsetLength]=0;
   
                                 connection.cstrClientCharset=cstrClientCharset;                                  connection.cstrClientCharset=cstrClientCharset;
Line 112  public: Line 112  public:
   
                 TRY {                  TRY {
                         connection.db=new CDatabase();                          connection.db=new CDatabase();
                         connection.db->OpenEx(used_only_in_connect_url, CDatabase::noOdbcDialog);                          connection.db->OpenEx(url, CDatabase::noOdbcDialog);
                         connection.db->BeginTrans();                          connection.db->BeginTrans();
                 }                   } 
                 CATCH_ALL (e) {                  CATCH_ALL (e) {

Removed from v.1.20  
changed lines
  Added in v.1.22


E-mail: