@@ -74,11 +74,31 @@ def test_classify_stmt(self):
7474 ("REVOKE SELECT ON TABLE Singers TO ROLE parent" , StatementType .DDL ),
7575 ("GRANT ROLE parent TO ROLE child" , StatementType .DDL ),
7676 ("INSERT INTO table (col1) VALUES (1)" , StatementType .INSERT ),
77+ ("INSERT table (col1) VALUES (1)" , StatementType .INSERT ),
78+ ("INSERT OR UPDATE table (col1) VALUES (1)" , StatementType .INSERT ),
79+ ("INSERT OR IGNORE table (col1) VALUES (1)" , StatementType .INSERT ),
7780 ("UPDATE table SET col1 = 1 WHERE col1 = NULL" , StatementType .UPDATE ),
81+ ("delete from table WHERE col1 = 2" , StatementType .UPDATE ),
82+ ("delete from table WHERE col1 in (select 1)" , StatementType .UPDATE ),
83+ ("dlete from table where col1 = 2" , StatementType .UNKNOWN ),
84+ ("udpate table set col2=1 where col1 = 2" , StatementType .UNKNOWN ),
85+ ("begin foo" , StatementType .UNKNOWN ),
86+ ("begin transaction foo" , StatementType .UNKNOWN ),
87+ ("commit foo" , StatementType .UNKNOWN ),
88+ ("commit transaction foo" , StatementType .UNKNOWN ),
89+ ("rollback foo" , StatementType .UNKNOWN ),
90+ ("rollback transaction foo" , StatementType .UNKNOWN ),
91+ ("show variable" , StatementType .UNKNOWN ),
92+ ("show variable read_timestamp foo" , StatementType .UNKNOWN ),
93+ ("INSERTs INTO table (col1) VALUES (1)" , StatementType .UNKNOWN ),
94+ ("UPDATEs table SET col1 = 1 WHERE col1 = NULL" , StatementType .UNKNOWN ),
95+ ("DELETEs from table WHERE col1 = 2" , StatementType .UNKNOWN ),
7896 )
7997
8098 for query , want_class in cases :
81- self .assertEqual (classify_statement (query ).statement_type , want_class )
99+ self .assertEqual (
100+ classify_statement (query ).statement_type , want_class , query
101+ )
82102
83103 def test_partition_query_classify_stmt (self ):
84104 parsed_statement = classify_statement (
0 commit comments