提交 063eb7ea authored 作者: Max Englander's avatar Max Englander

enum-support: fix/add tests

上级 f24ff527
...@@ -467,8 +467,9 @@ public class TestPreparedStatement extends TestBase { ...@@ -467,8 +467,9 @@ public class TestPreparedStatement extends TestBase {
rs.next(); rs.next();
} }
assertEquals(goodSizes[i], rs.getString(1)); assertEquals(goodSizes[i], rs.getString(1));
assertEquals(i, rs.getInt(1));
Object o = rs.getObject(1); Object o = rs.getObject(1);
assertEquals("java.lang.String", o.getClass().getName()); assertEquals(Integer.class, o.getClass());
} }
stat.execute("DROP TABLE test_enum"); stat.execute("DROP TABLE test_enum");
......
...@@ -10588,4 +10588,47 @@ create table z.z (id int); ...@@ -10588,4 +10588,47 @@ create table z.z (id int);
> ok > ok
drop schema z; drop schema z;
> ok > ok
\ No newline at end of file
--- enum support
create table card (rank int, suit enum('hearts', 'clubs', 'spades', 'diamonds'));
> ok
insert into card (rank, suit) values (0, 'clubs'), (3, 'hearts');
> update count: 2
select * from card;
> RANK SUIT
> ---- ------
> 0 clubs
> 3 hearts
select * from card order by suit;
> RANK SUIT
> ---- ------
> 3 hearts
> 0 clubs
insert into card (rank, suit) values (8, 'diamonds'), (10, 'clubs'), (7, 'hearts');
> update count: 3
select suit, count(rank) from card group by suit order by suit, count(rank);
> SUIT COUNT(RANK)
> -------- -----------
> hearts 2
> clubs 2
> diamonds 1
select rank from card where suit = 'diamonds';
> RANK
> ----
> 8
select rank from card where suit = 1;
> RANK
> ----
> 0
> 10
drop table card;
> ok
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论