| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007 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 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 SQLResultSet::SQLResultSet() | 37 SQLResultSet::SQLResultSet() |
| 38 : m_rows(SQLResultSetRowList::create()) | 38 : m_rows(SQLResultSetRowList::create()) |
| 39 , m_insertId(0) | 39 , m_insertId(0) |
| 40 , m_insertIdSet(false) | 40 , m_insertIdSet(false) |
| 41 , m_rowsAffected(0) | 41 , m_rowsAffected(0) |
| 42 { | 42 { |
| 43 ScriptWrappable::init(this); | 43 ScriptWrappable::init(this); |
| 44 } | 44 } |
| 45 | 45 |
| 46 int64_t SQLResultSet::insertId(ExceptionState& es) const | 46 int64_t SQLResultSet::insertId(ExceptionState& exceptionState) const |
| 47 { | 47 { |
| 48 // 4.11.4 - Return the id of the last row inserted as a result of the query | 48 // 4.11.4 - Return the id of the last row inserted as a result of the query |
| 49 // If the query didn't result in any rows being added, raise an InvalidAcces
sError exception | 49 // If the query didn't result in any rows being added, raise an InvalidAcces
sError exception |
| 50 if (m_insertIdSet) | 50 if (m_insertIdSet) |
| 51 return m_insertId; | 51 return m_insertId; |
| 52 | 52 |
| 53 es.throwUninformativeAndGenericDOMException(InvalidAccessError); | 53 exceptionState.throwUninformativeAndGenericDOMException(InvalidAccessError); |
| 54 return -1; | 54 return -1; |
| 55 } | 55 } |
| 56 | 56 |
| 57 int SQLResultSet::rowsAffected() const | 57 int SQLResultSet::rowsAffected() const |
| 58 { | 58 { |
| 59 return m_rowsAffected; | 59 return m_rowsAffected; |
| 60 } | 60 } |
| 61 | 61 |
| 62 SQLResultSetRowList* SQLResultSet::rows() const | 62 SQLResultSetRowList* SQLResultSet::rows() const |
| 63 { | 63 { |
| 64 return m_rows.get(); | 64 return m_rows.get(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 void SQLResultSet::setInsertId(int64_t id) | 67 void SQLResultSet::setInsertId(int64_t id) |
| 68 { | 68 { |
| 69 ASSERT(!m_insertIdSet); | 69 ASSERT(!m_insertIdSet); |
| 70 | 70 |
| 71 m_insertId = id; | 71 m_insertId = id; |
| 72 m_insertIdSet = true; | 72 m_insertIdSet = true; |
| 73 } | 73 } |
| 74 | 74 |
| 75 void SQLResultSet::setRowsAffected(int count) | 75 void SQLResultSet::setRowsAffected(int count) |
| 76 { | 76 { |
| 77 m_rowsAffected = count; | 77 m_rowsAffected = count; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } | 80 } |
| OLD | NEW |