** Attempt to determine if identifier zName needs to be quoted, either ** because it contains non-alphanumeric characters, or because it is an ** SQLite keyword. Be conservative in this estimate: When in doubt assume ** that quoting is required. ** ** Return '"' if quoting is required. Return 0 if no quoting is required. */
| 1001 | ** Return '"' if quoting is required. Return 0 if no quoting is required. |
| 1002 | */ |
| 1003 | static char quoteChar(const char *zName){ |
| 1004 | int i; |
| 1005 | if( !isalpha((unsigned char)zName[0]) && zName[0]!='_' ) return '"'; |
| 1006 | for(i=0; zName[i]; i++){ |
| 1007 | if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ) return '"'; |
| 1008 | } |
| 1009 | return sqlite3_keyword_check(zName, i) ? '"' : 0; |
| 1010 | } |
| 1011 | |
| 1012 | /* |
| 1013 | ** Construct a fake object name and column list to describe the structure |
no outgoing calls
no test coverage detected