Skip to content

Commit 5965c5a

Browse files
committed
Align import fixtures with supported driver behavior
Test MySQL backslash escapes with the default SQL mode, since the current driver explicitly rejects NO_BACKSLASH_ESCAPES. Keep assertions for every escape case and expect literal backslashes in quoted identifiers.
1 parent 182bf2c commit 5965c5a

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

‎features/sqlite-import.feature‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ Feature: WP-CLI SQLite Import Command
4545
And the SQLite database should contain the imported data
4646

4747
@require-sqlite
48-
Scenario: Import a file with escape sequences
48+
Scenario: Import a file with MySQL backslash escape sequences
4949
Given a SQL dump file named "test_import.sql" with content:
5050
"""
51-
SET sql_mode='NO_BACKSLASH_ESCAPES';
5251
CREATE TABLE test_table (id INTEGER PRIMARY KEY AUTO_INCREMENT, name TEXT);
5352
INSERT INTO test_table (name) VALUES ('Test that escaping a backslash \\ works');
5453
INSERT INTO test_table (name) VALUES ('Test that escaping multiple backslashes \\\\\\ works');
@@ -62,11 +61,11 @@ Feature: WP-CLI SQLite Import Command
6261
Success: Imported from 'test_import.sql'.
6362
"""
6463
And the SQLite database should contain a table named "test_table"
65-
And the "test_table" should contain a row with name "Test that escaping a backslash \\ works"
66-
And the "test_table" should contain a row with name "Test that escaping multiple backslashes \\\\\\ works"
67-
And the "test_table" should contain a row with name "Test that escaping a character \a works"
68-
And the "test_table" should contain a row with name "Test that escaping a backslash followed by a character \\a works"
69-
And the "test_table" should contain a row with name "Test that escaping a backslash and a character \\\a works"
64+
And the "test_table" should contain a row with name "Test that escaping a backslash \ works"
65+
And the "test_table" should contain a row with name "Test that escaping multiple backslashes \\\ works"
66+
And the "test_table" should contain a row with name "Test that escaping a character a works"
67+
And the "test_table" should contain a row with name "Test that escaping a backslash followed by a character \a works"
68+
And the "test_table" should contain a row with name "Test that escaping a backslash and a character \a works"
7069

7170
@require-sqlite
7271
Scenario: Import a file with newlines in strings
@@ -150,7 +149,7 @@ Feature: WP-CLI SQLite Import Command
150149
Success: Imported from 'test_import.sql'.
151150
"""
152151

153-
And the SQLite database should contain a table named "a'strange`identifier\name"
152+
And the SQLite database should contain a table named "a'strange`identifier\\name"
154153

155154
@require-sqlite
156155
Scenario: Import a file with whitespace and empty lines

0 commit comments

Comments
 (0)