Skip to content

Commit dc9d19e

Browse files
fix(kernel): reject streaming PUT without whitespace
Signed-off-by: Aakash Saravanan <aakash.saravanan@databricks.com>
1 parent 224a044 commit dc9d19e

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/databricks/sql/backend/kernel/client.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ def execute_command(
567567
stripped_sql = _strip_leading_sql_comments(operation)
568568
staging_verb = _staging_verb(stripped_sql)
569569
if re.match(
570-
r"""PUT\s+(['"])__input_stream__\1(?:\s|$)""",
570+
r"""PUT\s*(['"])__input_stream__\1(?:\s|$)""",
571571
stripped_sql,
572572
re.IGNORECASE,
573573
):

‎tests/unit/test_kernel_client.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,8 @@ def execute():
905905
[
906906
"PUT '__input_stream__' INTO '/Volumes/c/s/v/file'",
907907
"/* upload */ PUT '__input_stream__' INTO '/Volumes/c/s/v/file'",
908+
"PUT'__input_stream__' INTO '/Volumes/c/s/v/file'",
909+
'/* upload */ PUT"__input_stream__" INTO \'/Volumes/c/s/v/file\'',
908910
],
909911
)
910912
def test_kernel_rejects_streaming_put(query):

0 commit comments

Comments
 (0)