You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/sqlparser_common.rs
+60-2Lines changed: 60 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -27,6 +27,8 @@ extern crate core;
27
27
28
28
use helpers::attached_token::AttachedToken;
29
29
use matches::assert_matches;
30
+
use sqlparser::ast::helpers::key_value_options::*;
31
+
use sqlparser::ast::helpers::key_value_options::{KeyValueOptions, KeyValueOptionsDelimiter};
30
32
use sqlparser::ast::SelectItem::UnnamedExpr;
31
33
use sqlparser::ast::TableFactor::{Pivot, Unpivot};
32
34
use sqlparser::ast::*;
@@ -16259,13 +16261,69 @@ fn parse_notnull() {
16259
16261
16260
16262
#[test]
16261
16263
fn parse_create_user() {
16262
-
verified_stmt("CREATE USER u1");
16264
+
let create = verified_stmt("CREATE USER u1");
16265
+
match create {
16266
+
Statement::CreateUser(stmt) => {
16267
+
assert_eq!(stmt.name, Ident::new("u1"));
16268
+
}
16269
+
_ => unreachable!(),
16270
+
}
16263
16271
verified_stmt("CREATE OR REPLACE USER u1");
16264
16272
verified_stmt("CREATE OR REPLACE USER IF NOT EXISTS u1");
16265
16273
verified_stmt("CREATE OR REPLACE USER IF NOT EXISTS u1 PASSWORD='secret'");
16266
16274
verified_stmt(
16267
16275
"CREATE OR REPLACE USER IF NOT EXISTS u1 PASSWORD='secret' MUST_CHANGE_PASSWORD=TRUE",
16268
16276
);
16269
16277
verified_stmt("CREATE OR REPLACE USER IF NOT EXISTS u1 PASSWORD='secret' MUST_CHANGE_PASSWORD=TRUE TYPE=SERVICE TAG (t1='v1')");
16270
-
verified_stmt("CREATE OR REPLACE USER IF NOT EXISTS u1 PASSWORD='secret' MUST_CHANGE_PASSWORD=TRUE TYPE=SERVICE WITH TAG (t1='v1', t2='v2')");
16278
+
let create = verified_stmt("CREATE OR REPLACE USER IF NOT EXISTS u1 PASSWORD='secret' MUST_CHANGE_PASSWORD=TRUE TYPE=SERVICE WITH TAG (t1='v1', t2='v2')");
0 commit comments