提交 c01b4346 authored 作者: Thomas Mueller's avatar Thomas Mueller

Fulltext search: a NullPointerException was thrown when updating a value that was NULL previously.

上级 5ccb0378
......@@ -18,7 +18,9 @@ Change Log
<h1>Change Log</h1>
<h2>Next Version (unreleased)</h2>
<ul><li>The Recover tool did not work with .data.db files of the wrong size.
<ul><li>Fulltext search: a NullPointerException was thrown when updating a value that
was NULL previously.
</li><li>The Recover tool did not work with .data.db files of the wrong size.
</li><li>Triggers: if there was an exception when initializing a trigger, this exception could be hidden,
and in some cases (specially when using the Lucene fulltext index mechanism) a NullPointerException was
thrown later on. Now the exception that occurred on init is thrown when changing data.
......
......@@ -689,7 +689,11 @@ public class FullText {
static boolean hasChanged(Object[] oldRow, Object[] newRow, int[] indexColumns) {
for (int c : indexColumns) {
Object o = oldRow[c], n = newRow[c];
if (!o.equals(n)) {
if (o == null) {
if (n != null) {
return true;
}
} else if (!o.equals(n)) {
return true;
}
}
......
......@@ -86,6 +86,8 @@ public class TestFullText extends TestBase {
stat.execute("CREATE TABLE TEST(ID INT PRIMARY KEY, NAME VARCHAR)");
stat.execute("INSERT INTO TEST VALUES(1, 'Hello World')");
stat.execute("CALL " + prefix + "_CREATE_INDEX('PUBLIC', 'TEST', NULL)");
stat.execute("UPDATE TEST SET NAME=NULL WHERE ID=1");
stat.execute("UPDATE TEST SET NAME='Hello World' WHERE ID=1");
conn.close();
conn = getConnection("fullTextReopen");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论