SQLite

Check-in [9564d7008c]
Login

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

Overview
Comment:Fix harmless compiler warnings.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | alter-table-rename-column
Files: files | file ages | folders
SHA3-256: 9564d7008c3fd804401a5da6ea342c6f4261db14e9f994d1a38883358a7c6f8c
User & Date: drh 2018-08-10 19:33:09.840
Context
2018-08-10
20:19
Ensure the schema cookie is changed when a column is renamed. (check-in: 2dec9ea4ab user: dan tags: alter-table-rename-column)
19:33
Fix harmless compiler warnings. (check-in: 9564d7008c user: drh tags: alter-table-rename-column)
19:19
When a column is renamed, update any references to it in REFERENCES clauses that belong to other tables. (check-in: 191079bd4f user: dan tags: alter-table-rename-column)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/alter.c.
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
static void renameColumnFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  sqlite3 *db = sqlite3_context_db_handle(context);
  struct RenameCtx sCtx;
  const char *zSql = sqlite3_value_text(argv[0]);
  int nSql = sqlite3_value_bytes(argv[0]);
  const char *zNew = sqlite3_value_text(argv[2]);
  int nNew = sqlite3_value_bytes(argv[2]);
  const char *zTable = sqlite3_value_text(argv[3]);
  int nTable = sqlite3_value_bytes(argv[3]);
  const char *zOld = sqlite3_value_text(argv[4]);
  int nOld = sqlite3_value_bytes(argv[4]);

  int rc;
  char *zErr = 0;
  Parse sParse;
  Walker sWalker;
  Table *pTab;
  Index *pIdx;
  char *zOut = 0;

  char *zQuot = 0;                /* Quoted version of zNew */
  int nQuot = 0;                  /* Length of zQuot in bytes */
  int i;








|

|

|
<
|
<





<







929
930
931
932
933
934
935
936
937
938
939
940

941

942
943
944
945
946

947
948
949
950
951
952
953
static void renameColumnFunc(
  sqlite3_context *context,
  int NotUsed,
  sqlite3_value **argv
){
  sqlite3 *db = sqlite3_context_db_handle(context);
  struct RenameCtx sCtx;
  const char *zSql = (const char*)sqlite3_value_text(argv[0]);
  int nSql = sqlite3_value_bytes(argv[0]);
  const char *zNew = (const char*)sqlite3_value_text(argv[2]);
  int nNew = sqlite3_value_bytes(argv[2]);
  const char *zTable = (const char*)sqlite3_value_text(argv[3]);

  const char *zOld = (const char*)sqlite3_value_text(argv[4]);


  int rc;
  char *zErr = 0;
  Parse sParse;
  Walker sWalker;

  Index *pIdx;
  char *zOut = 0;

  char *zQuot = 0;                /* Quoted version of zNew */
  int nQuot = 0;                  /* Length of zQuot in bytes */
  int i;