MCPcopy Create free account
hub / github.com/MariaDB/server / make_json_valid_expr

Function make_json_valid_expr

sql/sql_select.cc:21852–21867  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21850
21851
21852static bool make_json_valid_expr(TABLE *table, Field *field)
21853{
21854 THD *thd= table->in_use;
21855 Query_arena backup_arena;
21856 Item *expr, *item_field;
21857
21858 if (!table->expr_arena && table->init_expr_arena(thd->mem_root))
21859 return 1;
21860
21861 thd->set_n_backup_active_arena(table->expr_arena, &backup_arena);
21862 if ((item_field= new (thd->mem_root) Item_field(thd, field)) &&
21863 (expr= new (thd->mem_root) Item_func_json_valid(thd, item_field)))
21864 field->check_constraint= add_virtual_expression(thd, expr);
21865 thd->restore_active_arena(table->expr_arena, &backup_arena);
21866 return field->check_constraint == NULL;
21867}
21868
21869
21870/**

Callers 2

create_tmp_fieldFunction · 0.85

Calls 4

add_virtual_expressionFunction · 0.85
init_expr_arenaMethod · 0.80
restore_active_arenaMethod · 0.80

Tested by

no test coverage detected