MCPcopy Create free account
hub / github.com/Meituan-Dianping/SQLAdvisor / init

Method init

sql/sql_class.h:3468–3487  ·  view source on GitHub ↗

Initialize all members @param name - Name of the user_var_entry instance. */

Source from the content-addressed store, hash-verified

3466 @param name - Name of the user_var_entry instance.
3467 */
3468 void init(const Simple_cstring &name)
3469 {
3470 copy_name(name);
3471 reset_value();
3472 update_query_id= 0;
3473 collation.set(NULL, DERIVATION_IMPLICIT, 0);
3474 unsigned_flag= 0;
3475 /*
3476 If we are here, we were called from a SET or a query which sets a
3477 variable. Imagine it is this:
3478 INSERT INTO t SELECT @a:=10, @a:=@a+1.
3479 Then when we have a Item_func_get_user_var (because of the @a+1) so we
3480 think we have to write the value of @a to the binlog. But before that,
3481 we have a Item_func_set_user_var to create @a (@a:=10), in this we mark
3482 the variable as "already logged" (line below) so that it won't be logged
3483 by Item_func_get_user_var (because that's not necessary).
3484 */
3485 used_query_id= current_thd->query_id;
3486 set_type(STRING_RESULT);
3487 }
3488
3489 /**
3490 Store a value of the given type into a user_var_entry instance.

Callers 1

createMethod · 0.45

Calls 1

setMethod · 0.45

Tested by

no test coverage detected