SQLite Forum

WAL2 branch build error

WAL2 branch build error

(1) By Tyke (tyke007) on 2021-08-09 05:17:30 [link] [source]


sqlite3.c:119983:56: error: no member named 'zName' in 'struct Column'; did you mean 'hName'?
      const char *zName = pTab->aCol[pPk->aiColumn[0]].zName;
sqlite3.c:16913:6: note: 'hName' declared here
  u8 hName;        /* Column name hash for faster lookup */
sqlite3.c:119983:19: warning: incompatible integer to pointer conversion initializing 'const char *' with an expression of type 'u8' (aka 'unsigned char') [-Wint-conversion]
      const char *zName = pTab->aCol[pPk->aiColumn[0]].zName;
                  ^       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqlite3.c:119989:71: error: no member named 'zName' in 'struct Column'
        Expr *p = sqlite3Expr(db, TK_ID, pTab->aCol[pPk->aiColumn[i]].zName);
                                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^
1 warning and 2 errors generated.

(2) By Tyke (tyke007) on 2021-08-09 07:46:42 in reply to 1 [link] [source]

patch to fix it:

diff --git a/src/delete.c b/src/delete.c
index 459e932b5..0debce3cb 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -188,13 +188,13 @@ Expr *sqlite3LimitWhere(
     Index *pPk = sqlite3PrimaryKeyIndex(pTab);
     if( pPk->nKeyCol==1 ){
-      const char *zName = pTab->aCol[pPk->aiColumn[0]].zName;
+      const char *zName = pTab->aCol[pPk->aiColumn[0]].zCnName;
       pLhs = sqlite3Expr(db, TK_ID, zName);
       pEList = sqlite3ExprListAppend(pParse, 0, sqlite3Expr(db, TK_ID, zName));
       int i;
       for(i=0; i<pPk->nKeyCol; i++){
-        Expr *p = sqlite3Expr(db, TK_ID, pTab->aCol[pPk->aiColumn[i]].zName);
+        Expr *p = sqlite3Expr(db, TK_ID, pTab->aCol[pPk->aiColumn[i]].zCnName);
         pEList = sqlite3ExprListAppend(pParse, pEList, p);
       pLhs = sqlite3PExpr(pParse, TK_VECTOR, 0, 0);

(3) By Dan Kennedy (dan) on 2021-08-09 11:05:16 in reply to 2 [source]

Quite correct I think. Merging the latest trunk changes included this identical patch:


The tip of wal2 should build now.