Skip to content

Commit

Permalink
Revert "fix"
Browse files Browse the repository at this point in the history
This reverts commit 48563dc.
  • Loading branch information
xiaoyu-meng-mxy committed Aug 28, 2024
1 parent 48563dc commit 08f7c09
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion mysql_mimic/variables.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Default: ...
"character_set_database": (str, CharacterSet.utf8mb4.name, True),
"character_set_results": (str, CharacterSet.utf8mb4.name, True),
"character_set_server": (str, CharacterSet.utf8mb4.name, True),
"collation_connection": (str, Collation.utf8mb4_0900_ai_ci.name, True),
"collation_connection": (str, Collation.utf8mb4_general_ci.name, True),
"collation_database": (str, Collation.utf8mb4_general_ci.name, True),
"collation_server": (str, Collation.utf8mb4_general_ci.name, True),
"external_user": (str, "", False),
Expand Down
19 changes: 8 additions & 11 deletions tests/test_query.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,6 @@ async def q3(sql: str) -> Sequence[Dict[str, Any]]:

async def q4(sql: str) -> Sequence[Dict[str, Any]]:
async with sqlalchemy_engine.connect() as conn:
# sqlglot by-default run `SET NAMES 'utf8mb4'` which removes COLLATE settings
# See https://github.com/sqlalchemy/sqlalchemy/discussions/7858
await conn.execute(text("SET NAMES 'utf8mb4' COLLATE 'utf8mb4_0900_ai_ci'"))
cursor = await conn.execute(text(sql))
if cursor.returns_rows:
return cursor.mappings().all() # type: ignore
Expand Down Expand Up @@ -373,12 +370,12 @@ async def test_query_attributes(
),
(
"""
SELECT
/*+ SET_VAR(max_execution_time=2) */
x
SELECT
/*+ SET_VAR(max_execution_time=2) */
x
FROM (
SELECT
/*+ SET_VAR(max_execution_time=1) */
SELECT
/*+ SET_VAR(max_execution_time=1) */
@@max_execution_time AS x
) AS a
""",
Expand Down Expand Up @@ -407,7 +404,7 @@ async def test_query_attributes(
"@@character_set_client": "utf8mb4",
"@@SESSION.character_set_connection": "utf8mb4",
"@@character_set_results": "utf8mb4",
"@@collation_connection": "utf8mb4_0900_ai_ci",
"@@collation_connection": "utf8mb4_general_ci",
}
],
),
Expand Down Expand Up @@ -656,7 +653,7 @@ async def test_query_attributes(
{"Value": "utf8mb4", "Variable_name": "character_set_results"},
{"Value": "utf8mb4", "Variable_name": "character_set_server"},
{
"Value": "utf8mb4_0900_ai_ci",
"Value": "utf8mb4_general_ci",
"Variable_name": "collation_connection",
},
{"Value": "utf8mb4_general_ci", "Variable_name": "collation_database"},
Expand Down Expand Up @@ -754,7 +751,7 @@ async def test_query_attributes(
"character_set_connection": "utf8mb4",
"character_set_results": "utf8mb4",
"character_set_server": "utf8mb4",
"collation_connection": "utf8mb4_0900_ai_ci",
"collation_connection": "utf8mb4_general_ci",
"collation_server": "utf8mb4_general_ci",
"init_connect": "",
"interactive_timeout": 28800,
Expand Down

0 comments on commit 08f7c09

Please sign in to comment.