| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #include "config.h" | 26 #include "config.h" |
| 27 #include "modules/webdatabase/sqlite/SQLiteStatement.h" | 27 #include "modules/webdatabase/sqlite/SQLiteStatement.h" |
| 28 | 28 |
| 29 #include "modules/webdatabase/sqlite/SQLValue.h" | 29 #include "modules/webdatabase/sqlite/SQLValue.h" |
| 30 #include "platform/Logging.h" | 30 #include "platform/Logging.h" |
| 31 #include "platform/heap/SafePoint.h" | 31 #include "platform/heap/SafePoint.h" |
| 32 #include "third_party/sqlite/sqlite3.h" |
| 32 #include "wtf/Assertions.h" | 33 #include "wtf/Assertions.h" |
| 33 #include "wtf/text/CString.h" | 34 #include "wtf/text/CString.h" |
| 34 #include <sqlite3.h> | |
| 35 | 35 |
| 36 // SQLite 3.6.16 makes sqlite3_prepare_v2 automatically retry preparing the stat
ement | 36 // SQLite 3.6.16 makes sqlite3_prepare_v2 automatically retry preparing the stat
ement |
| 37 // once if the database scheme has changed. We rely on this behavior. | 37 // once if the database scheme has changed. We rely on this behavior. |
| 38 #if SQLITE_VERSION_NUMBER < 3006016 | 38 #if SQLITE_VERSION_NUMBER < 3006016 |
| 39 #error SQLite version 3.6.16 or newer is required | 39 #error SQLite version 3.6.16 or newer is required |
| 40 #endif | 40 #endif |
| 41 | 41 |
| 42 namespace { | 42 namespace { |
| 43 | 43 |
| 44 // Only return error codes consistent with 3.7.6.3. | 44 // Only return error codes consistent with 3.7.6.3. |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 ASSERT(col >= 0); | 308 ASSERT(col >= 0); |
| 309 if (!m_statement) | 309 if (!m_statement) |
| 310 if (prepareAndStep() != SQLITE_ROW) | 310 if (prepareAndStep() != SQLITE_ROW) |
| 311 return 0; | 311 return 0; |
| 312 if (columnCount() <= col) | 312 if (columnCount() <= col) |
| 313 return 0; | 313 return 0; |
| 314 return sqlite3_column_int64(m_statement, col); | 314 return sqlite3_column_int64(m_statement, col); |
| 315 } | 315 } |
| 316 | 316 |
| 317 } // namespace blink | 317 } // namespace blink |
| OLD | NEW |