未验证 提交 6e7fb516 编写于 作者: J Joan Augsburger 提交者: GitHub

fix(griffin) - missing 'throws' (#423)

上级 7c660cef
......@@ -883,7 +883,7 @@ public class SqlCompiler implements Closeable {
}
if (metadata.getColumnType(columnIndex) != ColumnType.SYMBOL) {
SqlException.$(lexer.lastTokenPosition(), "Invalid column type - Column should be of type symbol");
throw SqlException.$(lexer.lastTokenPosition(), "Invalid column type - Column should be of type symbol");
}
writer.changeCacheFlag(columnIndex, cache);
......
......@@ -24,7 +24,9 @@
package io.questdb.griffin;
import io.questdb.cairo.*;
import io.questdb.cairo.RecordCursorPrinter;
import io.questdb.cairo.TableReader;
import io.questdb.cairo.TableWriter;
import io.questdb.cairo.sql.Record;
import io.questdb.cairo.sql.RecordMetadata;
import io.questdb.griffin.engine.functions.rnd.SharedRandom;
......@@ -35,8 +37,6 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import static io.questdb.griffin.CompiledQuery.ALTER;
public class AlterTableAlterSymbolColumnCacheFlagTest extends AbstractGriffinTest {
@Before
......@@ -49,6 +49,11 @@ public class AlterTableAlterSymbolColumnCacheFlagTest extends AbstractGriffinTes
assertFailure("alter table x alter column z", 28, "'add index' or 'cache' or 'nocache' expected");
}
@Test
public void testAlterFlagInNonSymbolColumn() throws Exception {
assertFailure("alter table x alter column b cache", 29, "Invalid column type - Column should be of type symbol");
}
@Test
public void testWhenCacheOrNocacheAreNotInAlterStatement() throws Exception {
assertFailure("alter table x alter column z ca", 29, "'cache' or 'nocache' expected");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册