/ Check-in [9afd7a2f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix harmless compiler warnings in the shell.c file
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9afd7a2ffd3a39456190ad05e85ff6485298aae262d9e0698a58c1d73507a36f
User & Date: drh 2017-06-15 13:07:56
Context
2017-06-15
16:45
Fix typo and improve the wording of the description of "Metadata" in the output of the sqlite3_analyzer tool. check-in: ca1ff707 user: drh tags: trunk
15:06
Merge the latest changes from trunk. check-in: 60105c22 user: drh tags: lsm-vtab
13:07
Fix harmless compiler warnings in the shell.c file check-in: 9afd7a2f user: drh tags: trunk
12:50
Improvements to the ".tables" command in the command-line shell so that it shows the name of all schemas if the name is anything other than "main". check-in: c7f778b7 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/shell.c.

  1213   1213        "TABLE",
  1214   1214        "INDEX",
  1215   1215        "UNIQUE INDEX",
  1216   1216        "VIEW",
  1217   1217        "TRIGGER",
  1218   1218        "VIRTUAL TABLE"
  1219   1219     };
  1220         -  int i = 0, n;
         1220  +  int i = 0;
  1221   1221     const char *zIn = (const char*)sqlite3_value_text(apVal[0]);
  1222   1222     const char *zSchema = (const char*)sqlite3_value_text(apVal[1]);
  1223   1223     assert( nVal==2 );
  1224   1224     if( zIn!=0 && strncmp(zIn, "CREATE ", 7)==0 ){
  1225   1225       for(i=0; i<sizeof(aPrefix)/sizeof(aPrefix[0]); i++){
  1226   1226         int n = strlen30(aPrefix[i]);
  1227   1227         if( strncmp(zIn+7, aPrefix[i], n)==0 && zIn[n+7]==' ' ){
................................................................................
  5814   5814           const char *zDb = (const char*)sqlite3_column_text(pStmt, 0);
  5815   5815           char zScNum[30];
  5816   5816           sqlite3_snprintf(sizeof(zScNum), zScNum, "%d", ++iSchema);
  5817   5817           appendText(&sSelect, zDiv, 0);
  5818   5818           zDiv = " UNION ALL ";
  5819   5819           if( strcmp(zDb, "main")!=0 ){
  5820   5820             appendText(&sSelect, "SELECT shell_add_schema(sql,", 0);
  5821         -          appendText(&sSelect, sqlite3_column_text(pStmt, 0), '"');
         5821  +          appendText(&sSelect, zDb, '"');
  5822   5822             appendText(&sSelect, ") AS sql, type, tbl_name, name, rowid,", 0);
  5823   5823             appendText(&sSelect, zScNum, 0);
  5824   5824             appendText(&sSelect, " AS snum, ", 0);
  5825   5825             appendText(&sSelect, zDb, '\'');
  5826   5826             appendText(&sSelect, " AS sname FROM ", 0);
  5827         -          appendText(&sSelect, sqlite3_column_text(pStmt, 0), '"');
         5827  +          appendText(&sSelect, zDb, '"');
  5828   5828             appendText(&sSelect, ".sqlite_master", 0);
  5829   5829           }else{
  5830   5830             appendText(&sSelect, "SELECT sql, type, tbl_name, name, rowid, ", 0);
  5831   5831             appendText(&sSelect, zScNum, 0);
  5832   5832             appendText(&sSelect, " AS snum, 'main' AS sname FROM sqlite_master",0);
  5833   5833           }
  5834   5834         }