| 63 | } |
| 64 | |
| 65 | func TestIsQuery(t *testing.T) { |
| 66 | a := assert.New(t) |
| 67 | a.True(isQuery("select * from iris.iris")) |
| 68 | a.True(isQuery("-- comment some thing\nselect * from iris.iris")) |
| 69 | a.True(isQuery("show create table iris.iris")) |
| 70 | a.True(isQuery("show databases")) |
| 71 | a.True(isQuery("show tables")) |
| 72 | a.True(isQuery("describe iris.iris")) |
| 73 | a.True(isQuery("desc iris.iris")) |
| 74 | a.True(isQuery("explain select 1")) |
| 75 | |
| 76 | a.False(isQuery("select * from iris.iris limit 10 into iris.tmp")) |
| 77 | a.False(isQuery("insert into iris.iris values ...")) |
| 78 | a.False(isQuery("delete from iris.iris where ...")) |
| 79 | a.False(isQuery("update iris.iris where ...")) |
| 80 | a.False(isQuery("drop table")) |
| 81 | } |
| 82 | |
| 83 | func TestParseTableColumn(tg *testing.T) { |
| 84 | a := assert.New(tg) |