** When the ".auth ON" is set, the following authorizer callback is ** invoked. It always returns SQLITE_OK. */
| 11913 | ** invoked. It always returns SQLITE_OK. |
| 11914 | */ |
| 11915 | static int shellAuth( |
| 11916 | void *pClientData, |
| 11917 | int op, |
| 11918 | const char *zA1, |
| 11919 | const char *zA2, |
| 11920 | const char *zA3, |
| 11921 | const char *zA4 |
| 11922 | ){ |
| 11923 | ShellState *p = (ShellState*)pClientData; |
| 11924 | static const char *azAction[] = { 0, |
| 11925 | "CREATE_INDEX", "CREATE_TABLE", "CREATE_TEMP_INDEX", |
| 11926 | "CREATE_TEMP_TABLE", "CREATE_TEMP_TRIGGER", "CREATE_TEMP_VIEW", |
| 11927 | "CREATE_TRIGGER", "CREATE_VIEW", "DELETE", |
| 11928 | "DROP_INDEX", "DROP_TABLE", "DROP_TEMP_INDEX", |
| 11929 | "DROP_TEMP_TABLE", "DROP_TEMP_TRIGGER", "DROP_TEMP_VIEW", |
| 11930 | "DROP_TRIGGER", "DROP_VIEW", "INSERT", |
| 11931 | "PRAGMA", "READ", "SELECT", |
| 11932 | "TRANSACTION", "UPDATE", "ATTACH", |
| 11933 | "DETACH", "ALTER_TABLE", "REINDEX", |
| 11934 | "ANALYZE", "CREATE_VTABLE", "DROP_VTABLE", |
| 11935 | "FUNCTION", "SAVEPOINT", "RECURSIVE" |
| 11936 | }; |
| 11937 | int i; |
| 11938 | const char *az[4]; |
| 11939 | az[0] = zA1; |
| 11940 | az[1] = zA2; |
| 11941 | az[2] = zA3; |
| 11942 | az[3] = zA4; |
| 11943 | utf8_printf(p->out, "authorizer: %s", azAction[op]); |
| 11944 | for(i=0; i<4; i++){ |
| 11945 | raw_printf(p->out, " "); |
| 11946 | if( az[i] ){ |
| 11947 | output_c_string(p->out, az[i]); |
| 11948 | }else{ |
| 11949 | raw_printf(p->out, "NULL"); |
| 11950 | } |
| 11951 | } |
| 11952 | raw_printf(p->out, "\n"); |
| 11953 | return SQLITE_OK; |
| 11954 | } |
| 11955 | #endif |
| 11956 | |
| 11957 | /* |
nothing calls this directly
no test coverage detected