hasMultipleStatements reports whether a batch has more than one non-empty statement. Multi-statement batches can change the session's default schema mid-batch (e.g. Postgres `SET search_path`), so DML/DDL in them falls back to the database-level check. SUP-222.
(statements []parserbase.Statement)
| 501 | // Multi-statement batches can change the session's default schema mid-batch (e.g. Postgres |
| 502 | // `SET search_path`), so DML/DDL in them falls back to the database-level check. SUP-222. |
| 503 | func hasMultipleStatements(statements []parserbase.Statement) bool { |
| 504 | n := 0 |
| 505 | for _, st := range statements { |
| 506 | if st.Empty { |
| 507 | continue |
| 508 | } |
| 509 | n++ |
| 510 | if n > 1 { |
| 511 | return true |
| 512 | } |
| 513 | } |
| 514 | return false |
| 515 | } |
| 516 | |
| 517 | func extractSourceTable(comment string) (string, string, string, error) { |
| 518 | pattern := `\((\w+),\s*(\w+)(?:,\s*(\w+))?\)` |
no outgoing calls
no test coverage detected