Skip to content

Commit 98556ef

Browse files
spetruniaAlexey Botchkov
authored andcommitted
MDEV-25142: JSON_TABLE: CREATE VIEW involving EXISTS PATH ends up with invalid frm
1 parent 93daad3 commit 98556ef

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

mysql-test/suite/json/t/json_table.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,17 @@ from
377377

378378
drop table t20,t21,t31,t32;
379379

380+
--echo #
381+
--echo # MDEV-25142: JSON_TABLE: CREATE VIEW involving EXISTS PATH ends up with invalid frm
382+
--echo #
383+
--disable_warnings
384+
drop view if exists v1;
385+
--enable_warnings
386+
387+
CREATE VIEW v1 AS SELECT * FROM JSON_TABLE('[]', '$' COLUMNS (f INT EXISTS PATH '$')) a ;
388+
show create view v1;
389+
drop view v1;
390+
380391
--echo #
381392
--echo # End of 10.6 tests
382393
--echo #

sql/json_table.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -982,7 +982,7 @@ int Json_table_column::print(THD *thd, Field **f, String *str)
982982
(*f)->sql_type(column_type);
983983

984984
if (str->append(column_type) ||
985-
str->append(m_column_type == PATH ? " PATH " : " EXISTS ") ||
985+
str->append(m_column_type == PATH ? " PATH " : " EXISTS PATH ") ||
986986
print_path(str, &m_path))
987987
return 1;
988988
break;

0 commit comments

Comments
 (0)