All pages
Powered by GitBook
1 of 1

Loading...

USER_VAR_EVENT

The USER_VAR_EVENT logs the value of a user-defined variable, ensuring that statements using variables replicate consistently.

A USER_VAR_EVENT is written every time a statement uses a user defined variable.

Header

  • Event Type is 14 (0x0e).

Fields

  • The length of the user variable name.

  • The name of the user variable.

  • NULL indicator.

  • If (not null indicator):

Variable type

Value
Type
Example

Flag

Example for SET @foo:="bar" From mysqlbinlog Utility, CRC32

Example Event as Written to the Binlog File

This page is licensed: CC BY-SA / Gnu FDL

uint<1> variable type.

  • uint<4> collation number.

  • uint<4> The length of value.

  • string value.

  • uint<1> flags.

  • 0x04

    DECIMAL_RESULT

    set @a:=1.2345

    0x00

    STRING_RESULT

    set @a:="foo"

    0x01

    REAL_RESULT

    set @a:= @@timestamp

    0x02

    INT_RESULT

    set @a:= 4

    0x03

    ROW_RESULT

    (not in use)

    0x01

    unsigned

    uint<4>
    string
    uint<1>
    # at 511
    #180610 10:26:43 server id 1  end_log_pos 554 CRC32 0x7dd93d6b 	User_var
    SET @`foo`:=_utf8 X'626172' COLLATE `utf8_general_ci`/*!*/;
    c3 e0 1c 5b 0e 01 00 00 00 2b 00       ...[.....+.
    00 00 2a 02 00 00 00 00 03 00 00 00 66 6f 6f 00  ..*.........foo.
    00 21 00 00 00 03 00 00 00 62 61 72 6b 3d d9 7d  .!.......bark=.}                                          ....