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 29 matching lines...) Expand all Loading... |
40 , m_insertId(0) | 40 , m_insertId(0) |
41 , m_insertIdSet(false) | 41 , m_insertIdSet(false) |
42 , m_rowsAffected(0) | 42 , m_rowsAffected(0) |
43 { | 43 { |
44 ScriptWrappable::init(this); | 44 ScriptWrappable::init(this); |
45 } | 45 } |
46 | 46 |
47 int64_t SQLResultSet::insertId(ExceptionCode& e) const | 47 int64_t SQLResultSet::insertId(ExceptionCode& e) const |
48 { | 48 { |
49 // 4.11.4 - Return the id of the last row inserted as a result of the query | 49 // 4.11.4 - Return the id of the last row inserted as a result of the query |
50 // If the query didn't result in any rows being added, raise an INVALID_ACCE
SS_ERR exception | 50 // If the query didn't result in any rows being added, raise an InvalidAcces
sError exception |
51 if (m_insertIdSet) | 51 if (m_insertIdSet) |
52 return m_insertId; | 52 return m_insertId; |
53 | 53 |
54 e = INVALID_ACCESS_ERR; | 54 e = InvalidAccessError; |
55 return -1; | 55 return -1; |
56 } | 56 } |
57 | 57 |
58 int SQLResultSet::rowsAffected() const | 58 int SQLResultSet::rowsAffected() const |
59 { | 59 { |
60 return m_rowsAffected; | 60 return m_rowsAffected; |
61 } | 61 } |
62 | 62 |
63 SQLResultSetRowList* SQLResultSet::rows() const | 63 SQLResultSetRowList* SQLResultSet::rows() const |
64 { | 64 { |
65 return m_rows.get(); | 65 return m_rows.get(); |
66 } | 66 } |
67 | 67 |
68 void SQLResultSet::setInsertId(int64_t id) | 68 void SQLResultSet::setInsertId(int64_t id) |
69 { | 69 { |
70 ASSERT(!m_insertIdSet); | 70 ASSERT(!m_insertIdSet); |
71 | 71 |
72 m_insertId = id; | 72 m_insertId = id; |
73 m_insertIdSet = true; | 73 m_insertIdSet = true; |
74 } | 74 } |
75 | 75 |
76 void SQLResultSet::setRowsAffected(int count) | 76 void SQLResultSet::setRowsAffected(int count) |
77 { | 77 { |
78 m_rowsAffected = count; | 78 m_rowsAffected = count; |
79 } | 79 } |
80 | 80 |
81 } | 81 } |
OLD | NEW |