Changeset 31
- Timestamp:
- 11/01/06 18:47:26 (2 years ago)
- Files:
-
- trunk/buildme.d (modified) (3 diffs)
- trunk/dbi/odbc/OdbcDatabase.d (modified) (4 diffs)
- trunk/dbi/odbc/OdbcResult.d (modified) (4 diffs)
- trunk/docs/buildme.html (modified) (1 diff)
- trunk/docs/dbi/odbc/OdbcDatabase.html (modified) (1 diff)
- trunk/docs/dbi/odbc/OdbcResult.html (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/buildme.d
r30 r31 34 34 * 2006-10-16 Changed build to bud. 35 35 * 2006-10-20 Fixed linux sleep issues. 36 * 2006-11-01 Non-Windows library names will now be in the proper style. 36 37 * 37 38 * Copyright: BSD license … … 72 73 switchesCompiler["-O"] = true; 73 74 } 74 switchesCompiler["-ofdbi"] = true; 75 version (Windows) { 76 switchesCompiler["-ofdbi.lib"] = true; 77 } else { 78 switchesCompiler["-oflibdbi.a"] = true; 79 } 75 80 version (Ares) { 76 81 switchesCompiler["-version=Ares"] = true; … … 86 91 switchesCompiler["-O3"] = true; 87 92 } 88 switchesCompiler["-o dbi.lib"]; 93 version (Windows) { 94 switchesCompiler["-o dbi.lib"]; 95 } else { 96 switchesCompiler["-o libdbi.a"]; 97 } 89 98 version (Ares) { 90 99 switchesCompiler["-fversion=Ares"] = true; trunk/dbi/odbc/OdbcDatabase.d
r27 r31 3 3 * 4 4 * Version: 0.2.4 5 * 6 * Modified: 7 * 2006-11-01 Added some casts around nulls. 5 8 * 6 9 * Copyright: BSD license … … 98 101 throw new DBIException("Unable to close an ODBC connection. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 99 102 } 100 connection = null;103 connection = cast(SQLHANDLE)null; 101 104 } 102 105 … … 166 169 */ 167 170 override void close () { 168 if (c onnection !is null && !SQL_SUCCEEDED(SQLDisconnect(connection))) {171 if (cast(void*)connection !is null && !SQL_SUCCEEDED(SQLDisconnect(connection))) { 169 172 if (getLastErrorMessage[0 .. 5] != "08003") { 170 173 throw new DBIException("Unable to disconnect from the database. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); … … 192 195 override void execute (char[] sql) { 193 196 scope (exit) 194 stmt = null;197 stmt = cast(SQLHANDLE)null; 195 198 scope (exit) 196 199 if (!SQL_SUCCEEDED(SQLFreeHandle(SQL_HANDLE_STMT, stmt))) { trunk/dbi/odbc/OdbcResult.d
r27 r31 3 3 * 4 4 * 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. 5 10 * 6 11 * Copyright: BSD license … … 59 64 throw new DBIException("Unable to get the SQL column type names. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 60 65 } 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))) { 62 67 throw new DBIException("Unable to get the SQL column names. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 63 68 } … … 93 98 buf[4 .. length] = cast(SQLCHAR)'\0'; 94 99 } 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 } 96 105 } 97 106 } … … 109 118 */ 110 119 override void finish () { 111 if ( stmt !is null) {120 if (cast(void*)stmt !is null) { 112 121 if (!SQL_SUCCEEDED(SQLFreeHandle(SQL_HANDLE_STMT, stmt))) { 113 122 throw new DBIException("Unable to destroy an ODBC statement. ODBC returned " ~ getLastErrorMessage, getLastErrorCode); 114 123 } 115 stmt = null;124 stmt = cast(SQLHANDLE)null; 116 125 } 117 126 } trunk/docs/buildme.html
r30 r31 87 87 2006-10-16 Changed build to bud. 88 88 2006-10-20 Fixed linux sleep issues. 89 2006-11-01 Non-Windows library names will now be in the proper style. 89 90 90 91 trunk/docs/dbi/odbc/OdbcDatabase.html
r28 r31 52 52 53 53 </p> 54 <strong>Modified:</strong> 55 2006-11-01 Added some casts around nulls. 56 57 54 58 55 59 <dl><dt><span class="big">class <span class="underline">OdbcDatabase</span>: dbi.Database.Database; trunk/docs/dbi/odbc/OdbcResult.html
r28 r31 52 52 53 53 </p> 54 <strong>Modified:</strong> 55 2006-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 54 60 55 61 <dl><dt><span class="big">class <span class="underline">OdbcResult</span>: dbi.Result.Result;
