Thank you for comments.
I found that this changed message occurs even on fresh 2.1.
kind of concerned with the patch and i decided to fix it at the same time.
(I don’t really think it does worth opening an issue).
I guess I should’ve wrote about it in the previous letter.
diff --git a/src/box/sql/func.c b/src/box/sql/func.c
index 5feab52f6..ed7926b18 100644
--- a/src/box/sql/func.c
+++ b/src/box/sql/func.c
@@ -1684,20 +1684,20 @@ setLikeOptFlag(sqlite3 * db, const char *zName, u8 flagVal)
* @retval none.
*/
void
-sqlite3RegisterLikeFunctions(sqlite3 *db, int *is_case_insensitive)
+sqlite3RegisterLikeFunctions(sqlite3 *db, int is_case_insensitive)
{
/*
* FIXME: after introducing type <BOOLEAN> LIKE must
* return that type: TRUE if the string matches the
* supplied pattern and FALSE otherwise.
*/
- int is_like_ci = SQLITE_PTR_TO_INT(is_case_insensitive);
+ int *is_like_ci = SQLITE_INT_TO_PTR(is_case_insensitive);
sqlite3CreateFunc(db, "LIKE", AFFINITY_INTEGER, 2, 0,
- is_case_insensitive, likeFunc, 0, 0, 0);
+ is_like_ci, likeFunc, 0, 0, 0);
sqlite3CreateFunc(db, "LIKE", AFFINITY_INTEGER, 3, 0,
- is_case_insensitive, likeFunc, 0, 0, 0);
+ is_like_ci, likeFunc, 0, 0, 0);
setLikeOptFlag(db, "LIKE",
- !(is_like_ci) ? (SQLITE_FUNC_LIKE |
+ !(is_case_insensitive) ? (SQLITE_FUNC_LIKE |
SQLITE_FUNC_CASE) : SQLITE_FUNC_LIKE);
}
diff --git a/src/box/sql/pragma.c b/src/box/sql/pragma.c
index 546b18ae2..8939aa702 100644
--- a/src/box/sql/pragma.c
+++ b/src/box/sql/pragma.c
@@ -586,10 +586,9 @@ sqlite3Pragma(Parse * pParse, Token * pId, /* First part of [schema.]id field */
*/
case PragTyp_CASE_SENSITIVE_LIKE:{
if (zRight) {
- int *is_like_ci =
- SQLITE_INT_TO_PTR(!(sqlite3GetBoolean(zRight, 0)));
- sqlite3RegisterLikeFunctions(db,
- is_like_ci);
+ int is_like_ci =
+ !(sqlite3GetBoolean(zRight, 0));
+ sqlite3RegisterLikeFunctions(db, is_like_ci);
}
break;
}
diff --git a/src/box/sql/sqliteInt.h b/src/box/sql/sqliteInt.h
index dd819622b..07e83e444 100644
--- a/src/box/sql/sqliteInt.h
+++ b/src/box/sql/sqliteInt.h
@@ -4551,7 +4551,7 @@ sql_key_info_unref(struct sql_key_info *key_info);
struct key_def *
sql_key_info_to_key_def(struct sql_key_info *key_info);
-void sqlite3RegisterLikeFunctions(sqlite3 *, int *);
+void sqlite3RegisterLikeFunctions(sqlite3 *, int);
int sql_is_like_func(sqlite3 *, Expr *, int *);
int sqlite3CreateFunc(sqlite3 *, const char *, enum affinity_type,
int, int, void *,