Skip to content

Commit 26dee1c

Browse files
committed
Merge branch 'main' into fix-oracle
2 parents a9e1abb + ead588f commit 26dee1c

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

mindsdb_sql_parser/ast/select/select.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@ def get_string(self, *args, **kwargs):
158158
]
159159
args_str = ', '.join(args)
160160
value = f'{value.type}({args_str})'
161+
if isinstance(value, Identifier):
162+
value = value.to_string()
161163
else:
162164
value = json.dumps(value)
163165

tests/test_base_sql/test_select_structure.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1326,13 +1326,15 @@ def test_lateral_join(self):
13261326
INNER JOIN LATERAL (SELECT *
13271327
FROM table2 b
13281328
WHERE a.x=b.x
1329-
LIMIT 1) b ON true
1329+
LIMIT 1) b ON 1=1
13301330
'''
13311331

13321332
expected_ast = Select(
13331333
targets=[Star()],
13341334
from_table=Join(
1335-
condition=Constant(True),
1335+
condition=BinaryOperation(op='=', args=[
1336+
Constant(1), Constant(1)
1337+
]),
13361338
join_type='INNER JOIN LATERAL',
13371339
left=Identifier('table1', alias=Identifier('a')),
13381340
right=Select(

tests/test_mindsdb/test_selects.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def test_select_using(self):
6868
sql = """
6969
SELECT status FROM tbl1
7070
group by 1
71-
using p1=1, p2='2'
71+
using p1=1, p2='2', p3=column
7272
"""
7373
ast = parse_sql(sql)
7474
expected_ast = Select(
@@ -77,7 +77,8 @@ def test_select_using(self):
7777
group_by=[Constant(1)],
7878
using={
7979
'p1': 1,
80-
'p2': '2'
80+
'p2': '2',
81+
'p3': Identifier('column')
8182
}
8283
)
8384

0 commit comments

Comments
 (0)