-
Notifications
You must be signed in to change notification settings - Fork 946
Update SQL span name for procedures #7557
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -232,12 +232,13 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) th | |||||||
|
||||||||
static class SimplifyArgs implements ArgumentsProvider { | ||||||||
|
||||||||
static Function<String, SqlStatementInfo> expect(String operation, String table) { | ||||||||
return sql -> SqlStatementInfo.create(sql, operation, table); | ||||||||
static Function<String, SqlStatementInfo> expect(String operation, String identifier) { | ||||||||
return sql -> SqlStatementInfo.create(sql, operation, identifier); | ||||||||
} | ||||||||
|
||||||||
static Function<String, SqlStatementInfo> expect(String sql, String operation, String table) { | ||||||||
return ignored -> SqlStatementInfo.create(sql, operation, table); | ||||||||
static Function<String, SqlStatementInfo> expect( | ||||||||
String sql, String operation, String identifier) { | ||||||||
return ignored -> SqlStatementInfo.create(sql, operation, identifier); | ||||||||
} | ||||||||
|
||||||||
@Override | ||||||||
|
@@ -275,6 +276,7 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) th | |||||||
Arguments.of("/* update comment */ select * from table1", expect("SELECT", "table1")), | ||||||||
Arguments.of("select /*((*/abc from table", expect("SELECT", "table")), | ||||||||
Arguments.of("SeLeCT * FrOm TAblE", expect("SELECT", "table")), | ||||||||
Arguments.of("select next value in hibernate_sequence", expect("SELECT", null)), | ||||||||
|
||||||||
// hibernate/jpa | ||||||||
Arguments.of("FROM schema.table", expect("SELECT", "schema.table")), | ||||||||
|
@@ -308,6 +310,12 @@ public Stream<? extends Arguments> provideArguments(ExtensionContext context) th | |||||||
expect("update \"my table\" set answer=?", "UPDATE", "my table")), | ||||||||
Arguments.of("update /*table", expect("UPDATE", null)), | ||||||||
|
||||||||
// Call | ||||||||
Arguments.of("call test_proc()", expect("CALL", "test_proc")), | ||||||||
Arguments.of("call test_proc", expect("CALL", "test_proc")), | ||||||||
Arguments.of("call next value in hibernate_sequence", expect("CALL", null)), | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (not sure what happens, but may be a good test also)
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @akats7 sorry it looks like this comment got resolved accidentally, does it make sense to add this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @trask Yep I did add it, its in the //Select section of the test cases |
||||||||
Arguments.of("call db.test_proc", expect("CALL", "db.test_proc")), | ||||||||
|
||||||||
// Merge | ||||||||
Arguments.of("merge into table", expect("MERGE", "table")), | ||||||||
Arguments.of("merge into `my table`", expect("MERGE", "my table")), | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: just a blank line to separate constants from fields: