Sqlite China  
首页 | 各种语言的sqlite编程 | sqlite研究 |sqlite应用实例与杂谈 | sqlite相关下载 | SQlite论坛
当前位置 : 主页>sqlite研究>列表
SQLite 3.3.13 中执行查询时的BUG
来源:工友 作者:工友 时间:2007-12-21

Under latest release 3.3.13 query results in crash (used to run fine)

To create tables/data, run this:
  CREATE TABLE inmk(
cls TEXT,
sec INTEGER,
inst INTEGER
);
INSERT INTO inmk VALUES ('ORD', 2751, 2750);
CREATE TABLE clss(
hrar TEXT,
cls TEXT,
PRIMARY KEY (hrar, cls)
);
CREATE TABLE rels(
prnt_inst INTEGER,
chld_inst INTEGER
);

Then run this query:

  SELECT I.sec
FROM inmk I
LEFT JOIN
rels R ON R.prnt_inst = I.inst
LEFT JOIN
inmk UI ON UI.inst = R.chld_inst
LEFT JOIN
clss C1U ON C1U.cls = UI.cls AND C1U.hrar = 'STH'
LEFT JOIN
clss C10U ON C10U.hrar = c1u.hrar AND C10U.cls IN (C1U.cls)
WHERE I.sec = 2751;

The crash only happens in the latest 3.3.13 build.

Observations

If "C10U.cls IN (C1U.cls)" is replaced with "C10U.cls = C1U.cls", the query does not result in a crash but obviously this is not how the original query look like. In the original one, be it

   ...AND C10U.cls IN (C1U.cls, C2U.cls...)

or

  AND (C10U.cls = C1U.cls OR C10U.cls = C2U.cls...)

is immaterial and the crash still results.

The presence of the primary key in 'clss' table also seems to be important for the crash to occur.

(阅读次数:
上一篇:嵌入式数据库sqlite在Motorola Coldfire + uclinux下的移植 下一篇:SQLite中的时间日期函数
[收藏] [推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]
用户名: 新注册) 密码: 匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
§最新评论
热点文章
·SQLite数据库的体系结构
·SQLite与其他数据库的速度
·SQL 语言参考资料
·SQLite语法备忘录
·sqlite 的相关调查1
·嵌入式数据库SQLite的一份
·SQLite在嵌入式Web服务器
·点评主流开源数据库的技术
·基于ARM-Linux的SQLite嵌
·SQLite与其他数据库的速度
·SQLite数据库编程--创建数
·SQL 语法手册
·SQLite Mode 数据库交互的
·SQLITE3 使用总结(3)
·XXTEA加密算法为SQLite 3.
·SQLite 第三版总览(简介)
·SQLite 第三版中的数据类
·用sqlite 执行标准 sql 语
·System.Data.Sqlite 上手
·SQLite编译安装步骤
相关文章
·SQLite Mode 数据库交互的
·SQL 语言参考资料
·SQLite在嵌入式Web服务器
·SQL 语法手册
·System.Data.Sqlite 上手
·SQLite数据库编程--创建数
·SQLite数据库编程--数据库
·SQLite在TorqueScript中的
·关于sqlite_exec回调函数
·用sqlite 执行标准 sql 语

版权Power by DedeCms   后台登陆
Copyright @ 2007