You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

sqlite.windows.patch001 5.6 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. diff -uprN sqlite-amalgamation-3310100/CMakeLists.txt sqlite-patch001/CMakeLists.txt
  2. --- sqlite-amalgamation-3310100/CMakeLists.txt 1970-01-01 08:00:00.000000000 +0800
  3. +++ sqlite-patch001/CMakeLists.txt 2020-05-25 10:47:36.902007755 +0800
  4. @@ -0,0 +1,6 @@
  5. +cmake_minimum_required(VERSION 3.14)
  6. +project (Sqlite[C])
  7. +add_library(sqlite3 SHARED sqlite3.c)
  8. +set_target_properties(sqlite3 PROPERTIES PUBLIC_HEADER "sqlite3.h;sqlite3ext.h")
  9. +include(GNUInstallDirs)
  10. +install(TARGETS sqlite3 PUBLIC_HEADER)
  11. diff -uprN sqlite-amalgamation-3310100/sqlite3.c sqlite-patch001/sqlite3.c
  12. --- sqlite-amalgamation-3310100/sqlite3.c 2020-01-28 04:25:14.000000000 +0800
  13. +++ sqlite-patch001/sqlite3.c 2020-05-25 10:49:04.057117196 +0800
  14. @@ -1167,7 +1167,7 @@ extern "C" {
  15. */
  16. #define SQLITE_VERSION "3.31.1"
  17. #define SQLITE_VERSION_NUMBER 3031001
  18. -#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6"
  19. +#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 bc2f42080a6a8a33048eedf289152768c416b2a7677a92111b3b1ea60d4aalt1"
  20. /*
  21. ** CAPI3REF: Run-Time Library Version Numbers
  22. @@ -17428,8 +17428,11 @@ struct Table {
  23. */
  24. #ifndef SQLITE_OMIT_VIRTUALTABLE
  25. # define IsVirtual(X) ((X)->nModuleArg)
  26. +# define ExprIsVtab(X) \
  27. + ((X)->op==TK_COLUMN && (X)->y.pTab!=0 && (X)->y.pTab->nModuleArg)
  28. #else
  29. # define IsVirtual(X) 0
  30. +# define ExprIsVtab(X) 0
  31. #endif
  32. /*
  33. @@ -104133,19 +104136,25 @@ static int impliesNotNullRow(Walker *pWa
  34. case TK_LT:
  35. case TK_LE:
  36. case TK_GT:
  37. - case TK_GE:
  38. + case TK_GE: {
  39. + Expr *pLeft = pExpr->pLeft;
  40. + Expr *pRight = pExpr->pRight;
  41. testcase( pExpr->op==TK_EQ );
  42. testcase( pExpr->op==TK_NE );
  43. testcase( pExpr->op==TK_LT );
  44. testcase( pExpr->op==TK_LE );
  45. testcase( pExpr->op==TK_GT );
  46. testcase( pExpr->op==TK_GE );
  47. - if( (pExpr->pLeft->op==TK_COLUMN && IsVirtual(pExpr->pLeft->y.pTab))
  48. - || (pExpr->pRight->op==TK_COLUMN && IsVirtual(pExpr->pRight->y.pTab))
  49. + /* The y.pTab=0 assignment in wherecode.c always happens after the
  50. + ** impliesNotNullRow() test */
  51. + if( (pLeft->op==TK_COLUMN && ALWAYS(pLeft->y.pTab!=0)
  52. + && IsVirtual(pLeft->y.pTab))
  53. + || (pRight->op==TK_COLUMN && ALWAYS(pRight->y.pTab!=0)
  54. + && IsVirtual(pRight->y.pTab))
  55. ){
  56. - return WRC_Prune;
  57. + return WRC_Prune;
  58. }
  59. -
  60. + }
  61. default:
  62. return WRC_Continue;
  63. }
  64. @@ -142591,7 +142600,8 @@ static int isAuxiliaryVtabOperator(
  65. ** MATCH(expression,vtab_column)
  66. */
  67. pCol = pList->a[1].pExpr;
  68. - if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
  69. + testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
  70. + if( ExprIsVtab(pCol) ){
  71. for(i=0; i<ArraySize(aOp); i++){
  72. if( sqlite3StrICmp(pExpr->u.zToken, aOp[i].zOp)==0 ){
  73. *peOp2 = aOp[i].eOp2;
  74. @@ -142613,7 +142623,8 @@ static int isAuxiliaryVtabOperator(
  75. ** with function names in an arbitrary case.
  76. */
  77. pCol = pList->a[0].pExpr;
  78. - if( pCol->op==TK_COLUMN && IsVirtual(pCol->y.pTab) ){
  79. + testcase( pCol->op==TK_COLUMN && pCol->y.pTab==0 );
  80. + if( ExprIsVtab(pCol) ){
  81. sqlite3_vtab *pVtab;
  82. sqlite3_module *pMod;
  83. void (*xNotUsed)(sqlite3_context*,int,sqlite3_value**);
  84. @@ -142636,10 +142647,12 @@ static int isAuxiliaryVtabOperator(
  85. int res = 0;
  86. Expr *pLeft = pExpr->pLeft;
  87. Expr *pRight = pExpr->pRight;
  88. - if( pLeft->op==TK_COLUMN && IsVirtual(pLeft->y.pTab) ){
  89. + testcase( pLeft->op==TK_COLUMN && pLeft->y.pTab==0 );
  90. + if( ExprIsVtab(pLeft) ){
  91. res++;
  92. }
  93. - if( pRight && pRight->op==TK_COLUMN && IsVirtual(pRight->y.pTab) ){
  94. + testcase( pRight && pRight->op==TK_COLUMN && pRight->y.pTab==0 );
  95. + if( pRight && ExprIsVtab(pRight) ){
  96. res++;
  97. SWAP(Expr*, pLeft, pRight);
  98. }
  99. @@ -223667,7 +223680,7 @@ static void fts5SourceIdFunc(
  100. ){
  101. assert( nArg==0 );
  102. UNUSED_PARAM2(nArg, apUnused);
  103. - sqlite3_result_text(pCtx, "fts5: 2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6", -1, SQLITE_TRANSIENT);
  104. + sqlite3_result_text(pCtx, "fts5: 2020-01-27 19:55:54 abc473fb8fb999005dc79a360e34f97b3b25429decf1820dd2afa5c19577753d", -1, SQLITE_TRANSIENT);
  105. }
  106. /*
  107. @@ -228440,9 +228453,9 @@ SQLITE_API int sqlite3_stmt_init(
  108. #endif /* !defined(SQLITE_CORE) || defined(SQLITE_ENABLE_STMTVTAB) */
  109. /************** End of stmt.c ************************************************/
  110. -#if __LINE__!=228443
  111. +#if __LINE__!=228456
  112. #undef SQLITE_SOURCE_ID
  113. -#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837balt2"
  114. +#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 bc2f42080a6a8a33048eedf289152768c416b2a7677a92111b3b1ea60d4aalt2"
  115. #endif
  116. /* Return the source-id for this library */
  117. SQLITE_API const char *sqlite3_sourceid(void){ return SQLITE_SOURCE_ID; }
  118. diff -uprN sqlite-amalgamation-3310100/sqlite3.h sqlite-patch001/sqlite3.h
  119. --- sqlite-amalgamation-3310100/sqlite3.h 2020-01-28 04:25:14.000000000 +0800
  120. +++ sqlite-patch001/sqlite3.h 2020-05-25 10:49:17.932970790 +0800
  121. @@ -125,7 +125,7 @@ extern "C" {
  122. */
  123. #define SQLITE_VERSION "3.31.1"
  124. #define SQLITE_VERSION_NUMBER 3031001
  125. -#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 3bfa9cc97da10598521b342961df8f5f68c7388fa117345eeb516eaa837bb4d6"
  126. +#define SQLITE_SOURCE_ID "2020-01-27 19:55:54 bc2f42080a6a8a33048eedf289152768c416b2a7677a92111b3b1ea60d4aalt1"
  127. /*
  128. ** CAPI3REF: Run-Time Library Version Numbers