Add parsing logic to match VALUES clause in nested insertion queries
This is a fix for SNOW-299744, where we extract "a single pair of parentheses with any text in between, as long as they contain balanced parenthesis" from the VALUES clause (i.e. (<possibly_nested_subqueries>) in INSERT INTO <table> VALUES (<possibly_nested_subqueries>)). The parser function counts ( and ) outside of single quote strings and returns the first balanced substring it finds, i.e. Input: (%s, %d, '))((' )(), Output: (%s, %d, '))((' ).
Codecov Report
Merging #659 (689c2e5) into master (f9217fc) will decrease coverage by
0.27%. The diff coverage is75.00%.
@@ Coverage Diff @@
## master #659 +/- ##
==========================================
- Coverage 82.77% 82.50% -0.28%
==========================================
Files 58 58
Lines 7397 7419 +22
Branches 1115 1123 +8
==========================================
- Hits 6123 6121 -2
- Misses 959 979 +20
- Partials 315 319 +4
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/snowflake/connector/cursor.py | 94.51% <66.66%> (-0.37%) |
:arrow_down: |
| src/snowflake/connector/util_text.py | 94.25% <77.77%> (-1.91%) |
:arrow_down: |
| src/snowflake/connector/ssl_wrap_socket.py | 71.21% <0.00%> (-3.04%) |
:arrow_down: |
| src/snowflake/connector/ocsp_snowflake.py | 71.96% <0.00%> (-1.44%) |
:arrow_down: |
| src/snowflake/connector/errors.py | 91.35% <0.00%> (-1.24%) |
:arrow_down: |
| src/snowflake/connector/network.py | 81.98% <0.00%> (-0.23%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update f9217fc...689c2e5. Read the comment docs.