Changeset 31

Show
Ignore:
Timestamp:
11/01/06 18:47:26 (2 years ago)
Author:
jpelcis
Message:

* buildme.d now puts non-Windows library names in the proper style.

  • davidl: Fixed an array bounds exception on null data in OdbcResult?.d.
  • davidl: Fixed a problem that sometimes caused the column name to be "" for ODBC.
  • Added some casts around nulls for ODBC.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/buildme.d

    r30 r31  
    3434 *  2006-10-16  Changed build to bud. 
    3535 *  2006-10-20  Fixed linux sleep issues. 
     36 *  2006-11-01  Non-Windows library names will now be in the proper style. 
    3637 * 
    3738 * Copyright: BSD license 
     
    7273            switchesCompiler["-O"] = true; 
    7374        } 
    74         switchesCompiler["-ofdbi"] = true; 
     75        version (Windows) { 
     76            switchesCompiler["-ofdbi.lib"] = true; 
     77        } else { 
     78            switchesCompiler["-oflibdbi.a"] = true; 
     79        } 
    7580        version (Ares) { 
    7681            switchesCompiler["-version=Ares"] = true; 
     
    8691            switchesCompiler["-O3"] = true; 
    8792        } 
    88         switchesCompiler["-o dbi.lib"]; 
     93        version (Windows) { 
     94            switchesCompiler["-o dbi.lib"]; 
     95        } else { 
     96            switchesCompiler["-o libdbi.a"]; 
     97        } 
    8998        version (Ares) { 
    9099            switchesCompiler["-fversion=Ares"] = true; 
  • trunk/dbi/odbc/OdbcDatabase.d

    r27 r31  
    33 * 
    44 * Version: 0.2.4 
     5 * 
     6 * Modified: 
     7 *  2006-11-01  Added some casts around nulls. 
    58 * 
    69 * Copyright: BSD license 
     
    98101            throw new DBIException("Unable to close an ODBC connection.  ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 
    99102        } 
    100         connection = null; 
     103        connection = cast(SQLHANDLE)null; 
    101104    } 
    102105 
     
    166169     */ 
    167170    override void close () { 
    168         if (connection !is null && !SQL_SUCCEEDED(SQLDisconnect(connection))) { 
     171        if (cast(void*)connection !is null && !SQL_SUCCEEDED(SQLDisconnect(connection))) { 
    169172            if (getLastErrorMessage[0 .. 5] != "08003") { 
    170173                throw new DBIException("Unable to disconnect from the database.  ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 
     
    192195    override void execute (char[] sql) { 
    193196        scope (exit) 
    194             stmt = null; 
     197            stmt = cast(SQLHANDLE)null; 
    195198        scope (exit) 
    196199            if (!SQL_SUCCEEDED(SQLFreeHandle(SQL_HANDLE_STMT, stmt))) { 
  • trunk/dbi/odbc/OdbcResult.d

    r27 r31  
    33 * 
    44 * Version: 0.2.4 
     5 * 
     6 * Modified: 
     7 *  2006-11-01  Fixed an array bounds exception on null data. 
     8 *  2006-11-01  Fixed a problem that sometimes caused the column name to be "". 
     9 *  2006-11-01  Added some casts around nulls. 
    510 * 
    611 * Copyright: BSD license 
     
    5964                throw new DBIException("Unable to get the SQL column type names.  ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 
    6065            } 
    61             if (!SQL_SUCCEEDED(SQLColAttribute(stmt, i, SQL_DESC_BASE_COLUMN_NAME, columnName, columnName.length, &columnNameLength, null))) { 
     66            if (!SQL_SUCCEEDED(SQLColAttribute(stmt, i, SQL_DESC_NAME, columnName, columnName.length, &columnNameLength, null))) { 
    6267                throw new DBIException("Unable to get the SQL column names.  ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 
    6368            } 
     
    9398                        buf[4 .. length] = cast(SQLCHAR)'\0'; 
    9499                    } 
    95                     row.addField(columnNames[i - 1], strip(cast(char[])buf[0 .. indicator]), columnTypesName[i - 1], columnTypesNum[i - 1]); 
     100                    if (indicator < 0) { 
     101                        row.addField(columnNames[i - 1], null, columnTypesName[i - 1], columnTypesNum[i - 1]); 
     102                    } else { 
     103                        row.addField(columnNames[i - 1], strip(cast(char[])buf[0 .. indicator]), columnTypesName[i - 1], columnTypesNum[i - 1]); 
     104                    } 
    96105                } 
    97106            } 
     
    109118     */ 
    110119    override void finish () { 
    111         if (stmt !is null) { 
     120        if (cast(void*)stmt !is null) { 
    112121            if (!SQL_SUCCEEDED(SQLFreeHandle(SQL_HANDLE_STMT, stmt))) { 
    113122                throw new DBIException("Unable to destroy an ODBC statement.  ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 
    114123            } 
    115             stmt = null; 
     124            stmt = cast(SQLHANDLE)null; 
    116125        } 
    117126    } 
  • trunk/docs/buildme.html

    r30 r31  
    87872006-10-16  Changed build to bud. 
    8888    2006-10-20  Fixed linux sleep issues. 
     89    2006-11-01  Non-Windows library names will now be in the proper style. 
    8990 
    9091 
  • trunk/docs/dbi/odbc/OdbcDatabase.html

    r28 r31  
    5252 
    5353</p> 
     54<strong>Modified:</strong> 
     552006-11-01  Added some casts around nulls. 
     56 
     57 
    5458 
    5559<dl><dt><span class="big">class <span class="underline">OdbcDatabase</span>: dbi.Database.Database; 
  • trunk/docs/dbi/odbc/OdbcResult.html

    r28 r31  
    5252 
    5353</p> 
     54<strong>Modified:</strong> 
     552006-11-01  Fixed an array bounds exception on <strong>null</strong> data. 
     56    2006-11-01  Fixed a problem that sometimes caused the column name to be "". 
     57    2006-11-01  Added some casts around nulls. 
     58 
     59 
    5460 
    5561<dl><dt><span class="big">class <span class="underline">OdbcResult</span>: dbi.Result.Result;