| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007, 2013 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2013 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 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 result_set_->SetInsertId(database->LastInsertRowID()); | 218 result_set_->SetInsertId(database->LastInsertRowID()); |
| 219 } else if (result == kSQLResultFull) { | 219 } else if (result == kSQLResultFull) { |
| 220 // Return the Quota error - the delegate will be asked for more space and | 220 // Return the Quota error - the delegate will be asked for more space and |
| 221 // this statement might be re-run. | 221 // this statement might be re-run. |
| 222 SetFailureDueToQuota(db); | 222 SetFailureDueToQuota(db); |
| 223 return false; | 223 return false; |
| 224 } else if (result == kSQLResultConstraint) { | 224 } else if (result == kSQLResultConstraint) { |
| 225 db->ReportExecuteStatementResult(6, SQLError::kConstraintErr, result); | 225 db->ReportExecuteStatementResult(6, SQLError::kConstraintErr, result); |
| 226 error_ = SQLErrorData::Create( | 226 error_ = SQLErrorData::Create( |
| 227 SQLError::kConstraintErr, | 227 SQLError::kConstraintErr, |
| 228 "could not execute statement due to a constaint failure", result, | 228 "could not execute statement due to a constraint failure", result, |
| 229 database->LastErrorMsg()); | 229 database->LastErrorMsg()); |
| 230 return false; | 230 return false; |
| 231 } else { | 231 } else { |
| 232 db->ReportExecuteStatementResult(5, SQLError::kDatabaseErr, result); | 232 db->ReportExecuteStatementResult(5, SQLError::kDatabaseErr, result); |
| 233 error_ = SQLErrorData::Create(SQLError::kDatabaseErr, | 233 error_ = SQLErrorData::Create(SQLError::kDatabaseErr, |
| 234 "could not execute statement", result, | 234 "could not execute statement", result, |
| 235 database->LastErrorMsg()); | 235 database->LastErrorMsg()); |
| 236 return false; | 236 return false; |
| 237 } | 237 } |
| 238 | 238 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 268 void SQLStatementBackend::ClearFailureDueToQuota() { | 268 void SQLStatementBackend::ClearFailureDueToQuota() { |
| 269 if (LastExecutionFailedDueToQuota()) | 269 if (LastExecutionFailedDueToQuota()) |
| 270 error_ = nullptr; | 270 error_ = nullptr; |
| 271 } | 271 } |
| 272 | 272 |
| 273 bool SQLStatementBackend::LastExecutionFailedDueToQuota() const { | 273 bool SQLStatementBackend::LastExecutionFailedDueToQuota() const { |
| 274 return error_ && error_->Code() == SQLError::kQuotaErr; | 274 return error_ && error_->Code() == SQLError::kQuotaErr; |
| 275 } | 275 } |
| 276 | 276 |
| 277 } // namespace blink | 277 } // namespace blink |
| OLD | NEW |