COM_STMT_EXECUTE

You are viewing an old version of this article. View the current version here.

COM_STMT_EXECUTE

executes a previously prepared statement.

Direction

client to server

Fields

int_1       COM_STMT_EXECUTE (0x17)
imt_4       statement id
int_1       flags:
              0 = no cursor
              1 = read only
              2 = cursor for update
              3 = scrollable cursor
int_4       Iteration count

if (param_count > 0)
{
  if (array_size == 1) {
    (param_count + 7)/8  null bitmap
  }
  1       send_types_to_server
  if (send_types_to_server)
  {
    param_count * 2      parameter types:
                         1st byte: field type
                         2nd byte: flag
                             32768 = unsigned
    if (extended_capabilities & MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32)
                             16384 = indicator variable used
  }

  for (i=0; i < Iteration count; i++)  {
    for (j=0; j < parameter per iteration; j++) {

      if (indicator_variable_used && 
         extended_capabilities & MARIADB_CLIENT_STMT_BULK_OPERATIONS >> 32) {
         int_1             indicator_variable:
                             STMT_INDICATOR_NULL = null value
                             STMT_INDICATOR_DEFAULT = default value
      }
      n                 parameter value
    }
  }
}

NULL-Bitmap

The NULL-Bitmap indicate if parameters are null (one bit per parameter) NULL-bitmap size is (parameter number + 7) / 8

Comments

Comments loading...
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.