sqllogictest

Check-in [c33e964f18]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an ODBC parameter that should not be NULL.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: c33e964f184d91bfa89b2747f4a3d89c3440ce34
User & Date: drh 2008-12-02 15:49:30.000
Context
2008-12-02
16:06
Fix the schema deleter in the ODBC3 driver so that it works with PostgreSQL. check-in: 0937105b6d user: drh tags: trunk
15:49
Fix an ODBC parameter that should not be NULL. check-in: c33e964f18 user: drh tags: trunk
15:22
Regened after changes to select2.tcl. check-in: 954bc6c11b user: shaneh tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/slt_odbc3.c.
318
319
320
321
322
323
324


325
326
327
328
329
330
331
    if( !pODBC3conn->zConnStr ){
      fprintf(stderr, "Out of memory at %s:%d\n", __FILE__, __LINE__);
      rc = 1;
    }
  }
  
  if( !rc ){


    /* Build the connection string.   If a DSN or DATABASE
    ** is not specified, use the defaults.
    */
    if( !zConnectStr || !strstr(zConnectStr, "DSN=") ){
      strcat(szConnStrIn, "DSN=" SLT_DSN ";");
    }
    if( !zConnectStr || !strstr(zConnectStr, "DATABASE=") ){







>
>







318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
    if( !pODBC3conn->zConnStr ){
      fprintf(stderr, "Out of memory at %s:%d\n", __FILE__, __LINE__);
      rc = 1;
    }
  }
  
  if( !rc ){
    SQLSMALLINT outStrLen;

    /* Build the connection string.   If a DSN or DATABASE
    ** is not specified, use the defaults.
    */
    if( !zConnectStr || !strstr(zConnectStr, "DSN=") ){
      strcat(szConnStrIn, "DSN=" SLT_DSN ";");
    }
    if( !zConnectStr || !strstr(zConnectStr, "DATABASE=") ){
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
    /* TBD: should we use SQLConnect() here? */
    ret = SQLDriverConnect(pODBC3conn->dbc, 
                           NULL, 
                           (SQLCHAR *)szConnStrIn, 
                           SQL_NTS,
                           pODBC3conn->zConnStr, 
                           1024 * sizeof(SQLCHAR), 
                           NULL,
                           SQL_DRIVER_COMPLETE);
    if( !SQL_SUCCEEDED(ret) && (ret != SQL_SUCCESS_WITH_INFO) ){
      ODBC3_perror("SQLDriverConnect", pODBC3conn->dbc, SQL_HANDLE_DBC);
      rc = 1;
    }
  }
  







|







342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
    /* TBD: should we use SQLConnect() here? */
    ret = SQLDriverConnect(pODBC3conn->dbc, 
                           NULL, 
                           (SQLCHAR *)szConnStrIn, 
                           SQL_NTS,
                           pODBC3conn->zConnStr, 
                           1024 * sizeof(SQLCHAR), 
                           &outStrLen,
                           SQL_DRIVER_COMPLETE);
    if( !SQL_SUCCEEDED(ret) && (ret != SQL_SUCCESS_WITH_INFO) ){
      ODBC3_perror("SQLDriverConnect", pODBC3conn->dbc, SQL_HANDLE_DBC);
      rc = 1;
    }
  }