| 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 20 matching lines...) Expand all Loading... |
| 31 #include "modules/webdatabase/sqlite/SQLValue.h" | 31 #include "modules/webdatabase/sqlite/SQLValue.h" |
| 32 #include "wtf/Assertions.h" | 32 #include "wtf/Assertions.h" |
| 33 #include "wtf/text/CString.h" | 33 #include "wtf/text/CString.h" |
| 34 | 34 |
| 35 // SQLite 3.6.16 makes sqlite3_prepare_v2 automatically retry preparing the stat
ement | 35 // SQLite 3.6.16 makes sqlite3_prepare_v2 automatically retry preparing the stat
ement |
| 36 // once if the database scheme has changed. We rely on this behavior. | 36 // once if the database scheme has changed. We rely on this behavior. |
| 37 #if SQLITE_VERSION_NUMBER < 3006016 | 37 #if SQLITE_VERSION_NUMBER < 3006016 |
| 38 #error SQLite version 3.6.16 or newer is required | 38 #error SQLite version 3.6.16 or newer is required |
| 39 #endif | 39 #endif |
| 40 | 40 |
| 41 namespace WebCore { | 41 namespace blink { |
| 42 | 42 |
| 43 SQLiteStatement::SQLiteStatement(SQLiteDatabase& db, const String& sql) | 43 SQLiteStatement::SQLiteStatement(SQLiteDatabase& db, const String& sql) |
| 44 : m_database(db) | 44 : m_database(db) |
| 45 , m_query(sql) | 45 , m_query(sql) |
| 46 , m_statement(0) | 46 , m_statement(0) |
| 47 #if ENABLE(ASSERT) | 47 #if ENABLE(ASSERT) |
| 48 , m_isPrepared(false) | 48 , m_isPrepared(false) |
| 49 #endif | 49 #endif |
| 50 { | 50 { |
| 51 } | 51 } |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 { | 266 { |
| 267 ASSERT(col >= 0); | 267 ASSERT(col >= 0); |
| 268 if (!m_statement) | 268 if (!m_statement) |
| 269 if (prepareAndStep() != SQLITE_ROW) | 269 if (prepareAndStep() != SQLITE_ROW) |
| 270 return 0; | 270 return 0; |
| 271 if (columnCount() <= col) | 271 if (columnCount() <= col) |
| 272 return 0; | 272 return 0; |
| 273 return sqlite3_column_int64(m_statement, col); | 273 return sqlite3_column_int64(m_statement, col); |
| 274 } | 274 } |
| 275 | 275 |
| 276 } // namespace WebCore | 276 } // namespace blink |
| OLD | NEW |