加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
6007-Fix-a-problem-causing-ENABLE_CURSOR_HINTS-builds-to-.patch 1.61 KB
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 11:17 . Package init
From 8bc9e8b38de805a0c02db12c6afe796a47b22747 Mon Sep 17 00:00:00 2001
From: Dan Kennedy <danielk1977@gmail.com>
Date: Tue, 11 Sep 2018 13:38:35 +0000
Subject: [PATCH 0363/1009] Fix a problem causing ENABLE_CURSOR_HINTS builds to
segfault.
https://github.com/mackyle/sqlite/commit/8bc9e8b38de805a0c02db12c6afe796a47b22747
---
src/wherecode.c | 4 +---
test/cursorhint2.test | 15 +++++++++++++++
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/src/wherecode.c b/src/wherecode.c
index 8251923..07de2c6 100644
--- a/src/wherecode.c
+++ b/src/wherecode.c
@@ -886,9 +886,7 @@ static int codeCursorHintFixExpr(Walker *pWalker, Expr *pExpr){
if( pExpr->iTable!=pHint->iTabCur ){
Vdbe *v = pWalker->pParse->pVdbe;
int reg = ++pWalker->pParse->nMem; /* Register for column value */
- sqlite3ExprCodeGetColumnOfTable(
- v, pExpr->pTab, pExpr->iTable, pExpr->iColumn, reg
- );
+ sqlite3ExprCode(pWalker->pParse, pExpr, reg);
pExpr->op = TK_REGISTER;
pExpr->iTable = reg;
}else if( pHint->pIdx!=0 ){
diff --git a/test/cursorhint2.test b/test/cursorhint2.test
index 0175568..a78d151 100644
--- a/test/cursorhint2.test
+++ b/test/cursorhint2.test
@@ -186,4 +186,19 @@ do_extract_hints_test 2.12 {
x2 {EQ(c0,r[2])}
}
+reset_db
+do_execsql_test 3.0 {
+ CREATE TABLE t1 (i1 TEXT);
+ CREATE TABLE t2 (i2 TEXT UNIQUE);
+ INSERT INTO t1 VALUES('0');
+ INSERT INTO t2 VALUES('0');
+}
+
+do_extract_hints_test 3.1 {
+ SELECT * FROM t1 CROSS JOIN t2 WHERE (t1.i1 = t2.i2) AND t2.i2 = 1;
+} {
+ t1 {EQ(c0,r[1])} t2 EQ(c0,1)
+}
+
+
finish_test
--
1.8.3.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化