Skip to content

Commit 719a34c

Browse files
feat(optimizer)!: annotate replace for mysql (#7774)
1 parent 5ad2add commit 719a34c

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

sqlglot/typing/mysql.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
expr_type: {"returns": exp.DType.VARCHAR}
2323
for expr_type in {
2424
exp.Elt,
25+
exp.Replace,
2526
}
2627
},
2728
**{

tests/fixtures/optimizer/annotate_functions.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6081,6 +6081,10 @@ VARCHAR;
60816081
CURRENT_TIMESTAMP();
60826082
DATETIME;
60836083

6084+
# dialect: mysql
6085+
REPLACE(tbl.str_col, tbl.str_col, tbl.str_col);
6086+
VARCHAR;
6087+
60846088
--------------------------------------
60856089
-- DuckDB
60866090
--------------------------------------

0 commit comments

Comments
 (0)