summaryrefslogtreecommitdiff
path: root/client
diff options
context:
space:
mode:
authorOleksandr Byelkin <sanja@mariadb.com>2020-06-11 23:12:48 +0200
committerOleksandr Byelkin <sanja@mariadb.com>2020-06-12 12:14:14 +0200
commit82f3ceed12063ac400a070b9c1972e139c59f385 (patch)
tree856b7e5f0b2afc73231311b5b84e698f751fa1f7 /client
parent8ec21afc8ed2df3b02815a45624b3287d5ffceae (diff)
downloadmariadb-git-82f3ceed12063ac400a070b9c1972e139c59f385.tar.gz
MDEV-16470: switch off user variables (and fixes of its support)bb-10.5-MDEV-22550
Diffstat (limited to 'client')
-rw-r--r--client/mysqltest.cc60
1 files changed, 36 insertions, 24 deletions
diff --git a/client/mysqltest.cc b/client/mysqltest.cc
index 55c4a66a89d..c278bb1aabd 100644
--- a/client/mysqltest.cc
+++ b/client/mysqltest.cc
@@ -7711,6 +7711,28 @@ void append_info(DYNAMIC_STRING *ds, ulonglong affected_rows,
}
+#ifndef EMBEDDED_LIBRARY
+static const char *trking_info_desc[SESSION_TRACK_END + 1]=
+{
+ "Tracker : SESSION_TRACK_SYSTEM_VARIABLES\n",
+ "Tracker : SESSION_TRACK_SCHEMA\n",
+ "Tracker : SESSION_TRACK_STATE_CHANGE\n",
+ "Tracker : SESSION_TRACK_GTIDS\n",
+ "Tracker : SESSION_TRACK_TRANSACTION_CHARACTERISTICS\n",
+ "Tracker : SESSION_TRACK_TRANSACTION_TYPE\n"
+#ifdef USER_VAR_TRACKING
+ ,
+ "Tracker : SESSION_TRACK_MYSQL_RESERVED1\n",
+ "Tracker : SESSION_TRACK_MYSQL_RESERVED2\n",
+ "Tracker : SESSION_TRACK_MYSQL_RESERVED3\n",
+ "Tracker : SESSION_TRACK_MYSQL_RESERVED4\n",
+ "Tracker : SESSION_TRACK_MYSQL_RESERVED5\n",
+ "Tracker : SESSION_TRACK_MYSQL_RESERVED6\n",
+ "Tracker : SESSION_TRACK_USER_VARIABLES\n"
+#endif // USER_VAR_TRACKING
+};
+#endif // EMBEDDED_LIBRARY
+
/**
@brief Append state change information (received through Ok packet) to the output.
@@ -7731,31 +7753,15 @@ static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql)
&data, &data_length))
{
dynstr_append(ds, "-- ");
- switch (type)
+ if (type <= SESSION_TRACK_END)
{
- case SESSION_TRACK_SYSTEM_VARIABLES:
- dynstr_append(ds, "Tracker : SESSION_TRACK_SYSTEM_VARIABLES\n");
- break;
- case SESSION_TRACK_SCHEMA:
- dynstr_append(ds, "Tracker : SESSION_TRACK_SCHEMA\n");
- break;
- case SESSION_TRACK_STATE_CHANGE:
- dynstr_append(ds, "Tracker : SESSION_TRACK_STATE_CHANGE\n");
- break;
- case SESSION_TRACK_GTIDS:
- dynstr_append(ds, "Tracker : SESSION_TRACK_GTIDS\n");
- break;
- case SESSION_TRACK_TRANSACTION_CHARACTERISTICS:
- dynstr_append(ds, "Tracker : SESSION_TRACK_TRANSACTION_CHARACTERISTICS\n");
- break;
- case SESSION_TRACK_TRANSACTION_TYPE:
- dynstr_append(ds, "Tracker : SESSION_TRACK_TRANSACTION_TYPE\n");
- break;
- default:
- DBUG_ASSERT(0);
- dynstr_append(ds, "\n");
+ dynstr_append(ds, trking_info_desc[type]);
+ }
+ else
+ {
+ DBUG_ASSERT(0);
+ dynstr_append(ds, "Tracker???\n");
}
-
dynstr_append(ds, "-- ");
dynstr_append_mem(ds, data, data_length);
@@ -7767,7 +7773,13 @@ static void append_session_track_info(DYNAMIC_STRING *ds, MYSQL *mysql)
&data, &data_length))
{
dynstr_append(ds, "\n-- ");
- dynstr_append_mem(ds, data, data_length);
+ if (data == NULL)
+ {
+ DBUG_ASSERT(data_length == 0);
+ dynstr_append_mem(ds, "<NULL>", sizeof("<NULL>") - 1);
+ }
+ else
+ dynstr_append_mem(ds, data, data_length);
}
dynstr_append(ds, "\n\n");
}