| OLD | NEW |
| 1 /* | 1 /* |
| 2 ** 2001 September 15 | 2 ** 2001 September 15 |
| 3 ** | 3 ** |
| 4 ** The author disclaims copyright to this source code. In place of | 4 ** The author disclaims copyright to this source code. In place of |
| 5 ** a legal notice, here is a blessing: | 5 ** a legal notice, here is a blessing: |
| 6 ** | 6 ** |
| 7 ** May you do good and not evil. | 7 ** May you do good and not evil. |
| 8 ** May you find forgiveness for yourself and forgive others. | 8 ** May you find forgiveness for yourself and forgive others. |
| 9 ** May you share freely, never taking more than you give. | 9 ** May you share freely, never taking more than you give. |
| 10 ** | 10 ** |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 ** returns 1 if it ends in the START state and 0 if it ends | 63 ** returns 1 if it ends in the START state and 0 if it ends |
| 64 ** in any other state. | 64 ** in any other state. |
| 65 ** | 65 ** |
| 66 ** (2) NORMAL We are in the middle of statement which ends with a single | 66 ** (2) NORMAL We are in the middle of statement which ends with a single |
| 67 ** semicolon. | 67 ** semicolon. |
| 68 ** | 68 ** |
| 69 ** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of | 69 ** (3) EXPLAIN The keyword EXPLAIN has been seen at the beginning of |
| 70 ** a statement. | 70 ** a statement. |
| 71 ** | 71 ** |
| 72 ** (4) CREATE The keyword CREATE has been seen at the beginning of a | 72 ** (4) CREATE The keyword CREATE has been seen at the beginning of a |
| 73 ** statement, possibly preceeded by EXPLAIN and/or followed by | 73 ** statement, possibly preceded by EXPLAIN and/or followed by |
| 74 ** TEMP or TEMPORARY | 74 ** TEMP or TEMPORARY |
| 75 ** | 75 ** |
| 76 ** (5) TRIGGER We are in the middle of a trigger definition that must be | 76 ** (5) TRIGGER We are in the middle of a trigger definition that must be |
| 77 ** ended by a semicolon, the keyword END, and another semicolon. | 77 ** ended by a semicolon, the keyword END, and another semicolon. |
| 78 ** | 78 ** |
| 79 ** (6) SEMI We've seen the first semicolon in the ";END;" that occurs at | 79 ** (6) SEMI We've seen the first semicolon in the ";END;" that occurs at |
| 80 ** the end of a trigger definition. | 80 ** the end of a trigger definition. |
| 81 ** | 81 ** |
| 82 ** (7) END We've seen the ";END" of the ";END;" that occurs at the end | 82 ** (7) END We've seen the ";END" of the ";END;" that occurs at the end |
| 83 ** of a trigger difinition. | 83 ** of a trigger definition. |
| 84 ** | 84 ** |
| 85 ** Transitions between states above are determined by tokens extracted | 85 ** Transitions between states above are determined by tokens extracted |
| 86 ** from the input. The following tokens are significant: | 86 ** from the input. The following tokens are significant: |
| 87 ** | 87 ** |
| 88 ** (0) tkSEMI A semicolon. | 88 ** (0) tkSEMI A semicolon. |
| 89 ** (1) tkWS Whitespace. | 89 ** (1) tkWS Whitespace. |
| 90 ** (2) tkOTHER Any other SQL token. | 90 ** (2) tkOTHER Any other SQL token. |
| 91 ** (3) tkEXPLAIN The "explain" keyword. | 91 ** (3) tkEXPLAIN The "explain" keyword. |
| 92 ** (4) tkCREATE The "create" keyword. | 92 ** (4) tkCREATE The "create" keyword. |
| 93 ** (5) tkTEMP The "temp" or "temporary" keyword. | 93 ** (5) tkTEMP The "temp" or "temporary" keyword. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 116 /* 1 START: */ { 1, 1, 2, 3, 4, 2, 2, 2, }, | 116 /* 1 START: */ { 1, 1, 2, 3, 4, 2, 2, 2, }, |
| 117 /* 2 NORMAL: */ { 1, 2, 2, 2, 2, 2, 2, 2, }, | 117 /* 2 NORMAL: */ { 1, 2, 2, 2, 2, 2, 2, 2, }, |
| 118 /* 3 EXPLAIN: */ { 1, 3, 3, 2, 4, 2, 2, 2, }, | 118 /* 3 EXPLAIN: */ { 1, 3, 3, 2, 4, 2, 2, 2, }, |
| 119 /* 4 CREATE: */ { 1, 4, 2, 2, 2, 4, 5, 2, }, | 119 /* 4 CREATE: */ { 1, 4, 2, 2, 2, 4, 5, 2, }, |
| 120 /* 5 TRIGGER: */ { 6, 5, 5, 5, 5, 5, 5, 5, }, | 120 /* 5 TRIGGER: */ { 6, 5, 5, 5, 5, 5, 5, 5, }, |
| 121 /* 6 SEMI: */ { 6, 6, 5, 5, 5, 5, 5, 7, }, | 121 /* 6 SEMI: */ { 6, 6, 5, 5, 5, 5, 5, 7, }, |
| 122 /* 7 END: */ { 1, 7, 5, 5, 5, 5, 5, 5, }, | 122 /* 7 END: */ { 1, 7, 5, 5, 5, 5, 5, 5, }, |
| 123 }; | 123 }; |
| 124 #else | 124 #else |
| 125 /* If triggers are not supported by this compile then the statement machine | 125 /* If triggers are not supported by this compile then the statement machine |
| 126 ** used to detect the end of a statement is much simplier | 126 ** used to detect the end of a statement is much simpler |
| 127 */ | 127 */ |
| 128 static const u8 trans[3][3] = { | 128 static const u8 trans[3][3] = { |
| 129 /* Token: */ | 129 /* Token: */ |
| 130 /* State: ** SEMI WS OTHER */ | 130 /* State: ** SEMI WS OTHER */ |
| 131 /* 0 INVALID: */ { 1, 0, 2, }, | 131 /* 0 INVALID: */ { 1, 0, 2, }, |
| 132 /* 1 START: */ { 1, 1, 2, }, | 132 /* 1 START: */ { 1, 1, 2, }, |
| 133 /* 2 NORMAL: */ { 1, 2, 2, }, | 133 /* 2 NORMAL: */ { 1, 2, 2, }, |
| 134 }; | 134 }; |
| 135 #endif /* SQLITE_OMIT_TRIGGER */ | 135 #endif /* SQLITE_OMIT_TRIGGER */ |
| 136 | 136 |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 if( zSql8 ){ | 274 if( zSql8 ){ |
| 275 rc = sqlite3_complete(zSql8); | 275 rc = sqlite3_complete(zSql8); |
| 276 }else{ | 276 }else{ |
| 277 rc = SQLITE_NOMEM; | 277 rc = SQLITE_NOMEM; |
| 278 } | 278 } |
| 279 sqlite3ValueFree(pVal); | 279 sqlite3ValueFree(pVal); |
| 280 return sqlite3ApiExit(0, rc); | 280 return sqlite3ApiExit(0, rc); |
| 281 } | 281 } |
| 282 #endif /* SQLITE_OMIT_UTF16 */ | 282 #endif /* SQLITE_OMIT_UTF16 */ |
| 283 #endif /* SQLITE_OMIT_COMPLETE */ | 283 #endif /* SQLITE_OMIT_COMPLETE */ |
| OLD | NEW |