Skip to content

Commit 007071a

Browse files
committed
add test for mysql
1 parent f9bfd7d commit 007071a

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

ibis-server/tests/routers/v2/connector/test_mysql.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,24 @@ async def test_connection_valid_ssl_mode(client, mysql_ssl_off: MySqlContainer):
475475
assert response.text == '"8.0.40"'
476476

477477

478+
async def test_order_by_nulls_last(client, manifest_str, mysql: MySqlContainer):
479+
connection_info = _to_connection_info(mysql)
480+
response = await client.post(
481+
url=f"{base_url}/query",
482+
json={
483+
"connectionInfo": connection_info,
484+
"manifestStr": manifest_str,
485+
"sql": "SELECT letter FROM (VALUES (1, 'one'), (2, 'two'), (null, 'three')) AS t (num, letter) ORDER BY num",
486+
},
487+
)
488+
assert response.status_code == 200
489+
result = response.json()
490+
assert len(result["data"]) == 3
491+
assert result["data"][0][0] == "one"
492+
assert result["data"][1][0] == "two"
493+
assert result["data"][2][0] == "three"
494+
495+
478496
def _to_connection_info(mysql: MySqlContainer):
479497
return {
480498
"host": mysql.get_container_host_ip(),

0 commit comments

Comments
 (0)