提交 194ebf95 authored 作者: Thomas Mueller Graf's avatar Thomas Mueller Graf

Local temporary tables with many rows did not work correctly due to automatic analyze.

上级 ad7c0e92
......@@ -21,6 +21,8 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Local temporary tables with many rows did not work correctly due to automatic analyze.
</li>
<li>Server mode: concurrently using the same connection could throw an exception
"Connection is broken: unexpected status".
</li>
......
......@@ -1620,6 +1620,8 @@ public class Database implements DataHandler {
int id = obj.getId();
removeMeta(session, id);
addMeta(session, obj);
// for temporary objects
objectIds.set(id);
}
/**
......
......@@ -6,6 +6,7 @@
package org.h2.test.db;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
......@@ -32,6 +33,7 @@ public class TestTempTables extends TestBase {
@Override
public void test() throws SQLException {
deleteDb("tempTables");
testAnalyzeReuseObjectId();
testTempSequence();
testTempFileResultSet();
testTempTableResultSet();
......@@ -49,6 +51,19 @@ public class TestTempTables extends TestBase {
deleteDb("tempTables");
}
private void testAnalyzeReuseObjectId() throws SQLException {
deleteDb("tempTables");
Connection conn = getConnection("tempTables");
Statement stat = conn.createStatement();
stat.execute("create local temporary table test(id identity)");
PreparedStatement prep = conn.prepareStatement("insert into test values(null)");
for(int i=0; i<10000; i++) {
prep.execute();
}
stat.execute("create local temporary table test2(id identity) as select x from system_range(1, 10)");
conn.close();
}
private void testTempSequence() throws SQLException {
deleteDb("tempTables");
Connection conn = getConnection("tempTables");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论