| OLD | NEW |
| 1 // Copyright 2008, Google Inc. | 1 // Copyright 2008, Google Inc. |
| 2 // | 2 // |
| 3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
| 4 // modification, are permitted provided that the following conditions are met: | 4 // modification, are permitted provided that the following conditions are met: |
| 5 // | 5 // |
| 6 // 1. Redistributions of source code must retain the above copyright notice, | 6 // 1. Redistributions of source code must retain the above copyright notice, |
| 7 // this list of conditions and the following disclaimer. | 7 // this list of conditions and the following disclaimer. |
| 8 // 2. Redistributions in binary form must reproduce the above copyright notice, | 8 // 2. Redistributions in binary form must reproduce the above copyright notice, |
| 9 // this list of conditions and the following disclaimer in the documentation | 9 // this list of conditions and the following disclaimer in the documentation |
| 10 // and/or other materials provided with the distribution. | 10 // and/or other materials provided with the distribution. |
| (...skipping 41 matching lines...) Show 10 above Show 10 below |
| 52 // create JS objects from collected rows | 52 // create JS objects from collected rows |
| 53 // stmt_->InvokeCallback(collected_rows); | 53 // stmt_->InvokeCallback(collected_rows); |
| 54 // if statement succeeded and callback failed, queue rollback op | 54 // if statement succeeded and callback failed, queue rollback op |
| 55 // else if statement failed and there is no callback, or callback did | 55 // else if statement failed and there is no callback, or callback did |
| 56 // not return false, queue rollback op | 56 // not return false, queue rollback op |
| 57 } | 57 } |
| 58 | 58 |
| 59 void Database2SyncExecuteCommand::Execute(bool *has_results) { | 59 void Database2SyncExecuteCommand::Execute(bool *has_results) { |
| 60 // TODO(dimitri.glazkov): Collect row results | 60 // TODO(dimitri.glazkov): Collect row results |
| 61 bool result = connection()->Execute(statement_->sql(), | 61 bool result = connection()->Execute(statement_->sql(), |
| 62 statement_->num_arguments(), | |
| 63 statement_->arguments(), NULL); | 62 statement_->arguments(), NULL); |
| 64 SetResult(result); | 63 SetResult(result); |
| 65 if (!result) { | 64 if (!result) { |
| 66 connection()->Rollback(); | 65 connection()->Rollback(); |
| 67 tx()->MarkClosed(); | 66 tx()->MarkClosed(); |
| 68 } | 67 } |
| 69 } | 68 } |
| 70 | 69 |
| 71 void Database2SyncExecuteCommand::HandleResults() { | 70 void Database2SyncExecuteCommand::HandleResults() { |
| 72 if (!success()) { | 71 if (!success()) { |
| (...skipping 36 matching lines...) Show 10 above Show 10 below |
| 109 tx()->InvokeErrorCallback(); | 108 tx()->InvokeErrorCallback(); |
| 110 } | 109 } |
| 111 | 110 |
| 112 void Database2RollbackCommand::Execute(bool *has_results) { | 111 void Database2RollbackCommand::Execute(bool *has_results) { |
| 113 // stub | 112 // stub |
| 114 } | 113 } |
| 115 | 114 |
| 116 void Database2RollbackCommand::HandleResults() { | 115 void Database2RollbackCommand::HandleResults() { |
| 117 // stub | 116 // stub |
| 118 } | 117 } |
| 119 | |
| 120 | |
| OLD | NEW |