37
37
Add full support for the variable character_set (for 4.1)
40
Be careful with var->save_result: sys_var::check() only updates
41
uint64_t_value; so other members of the union are garbage then; to use
42
them you must first assign a value to them (in specific ::check() for
47
#include "drizzled/option.h"
48
#include "drizzled/error.h"
49
#include "drizzled/gettext.h"
50
#include "drizzled/tztime.h"
51
#include "drizzled/data_home.h"
52
#include "drizzled/set_var.h"
53
#include "drizzled/session.h"
54
#include "drizzled/sql_base.h"
55
#include "drizzled/lock.h"
56
#include "drizzled/item/uint.h"
57
#include "drizzled/item/null.h"
58
#include "drizzled/item/float.h"
59
#include "drizzled/item/string.h"
60
#include "drizzled/plugin.h"
61
#include "drizzled/version.h"
62
#include "drizzled/strfunc.h"
63
#include "drizzled/internal/m_string.h"
64
#include "drizzled/pthread_globals.h"
65
#include "drizzled/charset.h"
66
#include "drizzled/transaction_services.h"
67
#include "drizzled/constrained_value.h"
42
#include <drizzled/option.h>
43
#include <drizzled/error.h>
44
#include <drizzled/gettext.h>
45
#include <drizzled/tztime.h>
46
#include <drizzled/data_home.h>
47
#include <drizzled/set_var.h>
48
#include <drizzled/session.h>
49
#include <drizzled/sql_base.h>
50
#include <drizzled/lock.h>
51
#include <drizzled/item/uint.h>
52
#include <drizzled/item/null.h>
53
#include <drizzled/item/float.h>
54
#include <drizzled/item/string.h>
55
#include <drizzled/plugin.h>
56
#include <drizzled/version.h>
57
#include <drizzled/strfunc.h>
58
#include <drizzled/internal/m_string.h>
59
#include <drizzled/pthread_globals.h>
60
#include <drizzled/charset.h>
61
#include <drizzled/transaction_services.h>
62
#include <drizzled/constrained_value.h>
63
#include <drizzled/visibility.h>
64
#include <drizzled/typelib.h>
65
#include <drizzled/plugin/storage_engine.h>
110
108
static void fix_max_join_size(Session *session, sql_var_t type);
111
109
static void fix_session_mem_root(Session *session, sql_var_t type);
112
110
static void fix_server_id(Session *session, sql_var_t type);
113
static bool get_unsigned32(Session *session, set_var *var);
114
static bool get_unsigned64(Session *session, set_var *var);
115
111
bool throw_bounds_warning(Session *session, bool fixed, bool unsignd,
116
112
const std::string &name, int64_t val);
117
113
static unsigned char *get_error_count(Session *session);
156
152
&drizzle_system_variables::join_buff_size);
157
153
static sys_var_session_uint32_t sys_max_allowed_packet("max_allowed_packet",
158
154
&drizzle_system_variables::max_allowed_packet);
159
static sys_var_uint64_t_ptr sys_max_connect_errors("max_connect_errors",
160
&max_connect_errors);
161
155
static sys_var_session_uint64_t sys_max_error_count("max_error_count",
162
156
&drizzle_system_variables::max_error_count);
163
157
static sys_var_session_uint64_t sys_max_heap_table_size("max_heap_table_size",
220
214
static sys_var_session_size_t sys_sort_buffer("sort_buffer_size",
221
215
&drizzle_system_variables::sortbuff_size);
223
static sys_var_session_size_t sys_transaction_message_threshold("transaction_message_threshold",
224
&drizzle_system_variables::transaction_message_threshold);
217
static sys_var_size_t_ptr_readonly sys_transaction_message_threshold("transaction_message_threshold",
218
&transaction_message_threshold);
226
220
static sys_var_session_storage_engine sys_storage_engine("storage_engine",
227
221
&drizzle_system_variables::storage_engine);
228
static sys_var_const_str sys_system_time_zone("system_time_zone",
230
222
static sys_var_size_t_ptr sys_table_def_size("table_definition_cache",
231
223
&table_def_size);
232
224
static sys_var_uint64_t_ptr sys_table_cache_size("table_open_cache",
477
static bool get_unsigned32(Session *session, set_var *var)
479
if (var->value->unsigned_flag)
480
var->save_result.uint32_t_value=
481
static_cast<uint32_t>(var->value->val_int());
484
int64_t v= var->value->val_int();
486
throw_bounds_warning(session, true, true,var->var->getName().c_str(), v);
488
var->save_result.uint32_t_value=
489
static_cast<uint32_t>((v > UINT32_MAX) ? UINT32_MAX : (v < 0) ? 0 : v);
494
static bool get_unsigned64(Session *, set_var *var)
496
if (var->value->unsigned_flag)
497
var->save_result.uint64_t_value=(uint64_t) var->value->val_int();
500
int64_t v= var->value->val_int();
501
var->save_result.uint64_t_value= (uint64_t) ((v < 0) ? 0 : v);
506
static bool get_size_t(Session *, set_var *var)
508
if (var->value->unsigned_flag)
509
var->save_result.size_t_value= (size_t) var->value->val_int();
512
ssize_t v= (ssize_t)var->value->val_int();
513
var->save_result.size_t_value= (size_t) ((v < 0) ? 0 : v);
518
467
bool sys_var_uint32_t_ptr::check(Session *, set_var *var)
520
var->save_result.uint32_t_value= (uint32_t)var->value->val_int();
524
473
bool sys_var_uint32_t_ptr::update(Session *session, set_var *var)
526
uint32_t tmp= var->save_result.uint32_t_value;
527
LOCK_global_system_variables.lock();
475
uint64_t tmp= var->getInteger();
476
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
528
478
if (option_limits)
530
480
uint32_t newvalue= (uint32_t) fix_unsigned(session, tmp, option_limits);
481
if(static_cast<uint64_t>(newvalue) == tmp)
532
482
*value= newvalue;
535
*value= (uint32_t) tmp;
536
LOCK_global_system_variables.unlock();
486
*value= static_cast<uint32_t>(tmp);
541
void sys_var_uint32_t_ptr::set_default(Session *, sql_var_t)
493
void sys_var_uint32_t_ptr::set_default(Session *session, sql_var_t)
544
LOCK_global_system_variables.lock();
496
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
545
497
*value= (uint32_t)getopt_ull_limit_value((uint32_t) option_limits->def_value,
546
498
option_limits, ¬_used);
547
LOCK_global_system_variables.unlock();
551
502
bool sys_var_uint64_t_ptr::update(Session *session, set_var *var)
553
uint64_t tmp= var->save_result.uint64_t_value;
554
LOCK_global_system_variables.lock();
504
uint64_t tmp= var->getInteger();
505
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
555
507
if (option_limits)
557
uint64_t newvalue= (uint64_t) fix_unsigned(session, tmp, option_limits);
509
uint64_t newvalue= fix_unsigned(session, tmp, option_limits);
558
510
if(newvalue==tmp)
559
511
*value= newvalue;
562
*value= (uint64_t) tmp;
563
LOCK_global_system_variables.unlock();
568
void sys_var_uint64_t_ptr::set_default(Session *, sql_var_t)
522
void sys_var_uint64_t_ptr::set_default(Session *session, sql_var_t)
570
524
if (have_default_value)
577
LOCK_global_system_variables.lock();
531
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
578
532
*value= getopt_ull_limit_value((uint64_t) option_limits->def_value,
579
533
option_limits, ¬_used);
580
LOCK_global_system_variables.unlock();
585
538
bool sys_var_size_t_ptr::update(Session *session, set_var *var)
587
size_t tmp= var->save_result.size_t_value;
588
LOCK_global_system_variables.lock();
540
size_t tmp= size_t(var->getInteger());
542
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
589
544
if (option_limits)
590
545
*value= fix_size_t(session, tmp, option_limits);
593
LOCK_global_system_variables.unlock();
598
void sys_var_size_t_ptr::set_default(Session *, sql_var_t)
553
void sys_var_size_t_ptr::set_default(Session *session, sql_var_t)
601
LOCK_global_system_variables.lock();
556
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
602
557
*value= (size_t)getopt_ull_limit_value((size_t) option_limits->def_value,
603
558
option_limits, ¬_used);
604
LOCK_global_system_variables.unlock();
561
bool sys_var_bool_ptr::check(Session *session, set_var *var)
563
return check_enum(session, var, &bool_typelib);
607
566
bool sys_var_bool_ptr::update(Session *, set_var *var)
609
*value= (bool) var->save_result.uint32_t_value;
568
*value= bool(var->getInteger());
623
582
bool sys_var_session_uint32_t::check(Session *session, set_var *var)
625
return (get_unsigned32(session, var) ||
626
(check_func && (*check_func)(session, var)));
585
return (check_func && (*check_func)(session, var));
629
588
bool sys_var_session_uint32_t::update(Session *session, set_var *var)
631
uint64_t tmp= (uint64_t) var->save_result.uint32_t_value;
590
uint64_t tmp= var->getInteger();
633
592
/* Don't use bigger value than given with --maximum-variable-name=.. */
634
593
if ((uint32_t) tmp > max_system_variables.*offset)
710
671
/* We will not come here if option_limits is not set */
711
LOCK_global_system_variables.lock();
672
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
712
673
global_system_variables.*offset=
713
674
(ha_rows) getopt_ull_limit_value((ha_rows) option_limits->def_value,
714
675
option_limits, ¬_used);
715
LOCK_global_system_variables.unlock();
718
679
session->variables.*offset= global_system_variables.*offset;
731
693
bool sys_var_session_uint64_t::check(Session *session, set_var *var)
733
return (get_unsigned64(session, var) ||
734
(check_func && (*check_func)(session, var)));
696
return (check_func && (*check_func)(session, var));
737
699
bool sys_var_session_uint64_t::update(Session *session, set_var *var)
739
uint64_t tmp= var->save_result.uint64_t_value;
701
uint64_t tmp= var->getInteger();
741
703
if (tmp > max_system_variables.*offset)
787
752
bool sys_var_session_size_t::check(Session *session, set_var *var)
789
return (get_size_t(session, var) ||
790
(check_func && (*check_func)(session, var)));
755
return (check_func && (*check_func)(session, var));
793
758
bool sys_var_session_size_t::update(Session *session, set_var *var)
795
size_t tmp= var->save_result.size_t_value;
760
size_t tmp= size_t(var->getInteger());
797
762
if (tmp > max_system_variables.*offset)
798
763
tmp= max_system_variables.*offset;
837
805
return (unsigned char*) &(session->variables.*offset);
808
bool sys_var_session_bool::check(Session *session, set_var *var)
810
return check_enum(session, var, &bool_typelib);
841
813
bool sys_var_session_bool::update(Session *session, set_var *var)
843
815
if (var->type == OPT_GLOBAL)
844
global_system_variables.*offset= (bool) var->save_result.uint32_t_value;
816
global_system_variables.*offset= bool(var->getInteger());
846
session->variables.*offset= (bool) var->save_result.uint32_t_value;
818
session->variables.*offset= bool(var->getInteger());
877
850
if (var->value->result_type() == STRING_RESULT)
879
if (!(res=var->value->val_str(&str)) ||
880
(var->save_result.uint32_t_value= find_type(enum_names, res->ptr(),
881
res->length(),1)) == 0)
852
res= var->value->val_str(&str);
883
value= res ? res->c_ptr() : "NULL";
887
var->save_result.uint32_t_value--;
859
uint64_t tmp_val= enum_names->find_type(res->ptr(), res->length(), true);
865
var->setValue(tmp_val-1);
891
uint64_t tmp=var->value->val_int();
869
uint64_t tmp= var->value->val_int();
892
870
if (tmp >= enum_names->count)
894
872
internal::llstr(tmp,buff);
895
873
value=buff; // Wrong value is here
898
var->save_result.uint32_t_value= (uint32_t) tmp; // Save for update
876
var->setValue(tmp); // Save for update
934
LOCK_global_system_variables.lock();
912
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
935
913
value= *(uint*) value_ptr(session, var_type, base);
936
LOCK_global_system_variables.unlock();
937
915
return new Item_uint((uint64_t) value);
939
917
case SHOW_LONGLONG:
942
LOCK_global_system_variables.lock();
920
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
943
921
value= *(int64_t*) value_ptr(session, var_type, base);
944
LOCK_global_system_variables.unlock();
945
923
return new Item_int(value);
947
925
case SHOW_DOUBLE:
950
LOCK_global_system_variables.lock();
951
value= *(double*) value_ptr(session, var_type, base);
952
LOCK_global_system_variables.unlock();
929
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
930
value= *(double*) value_ptr(session, var_type, base);
953
933
/* 6, as this is for now only used with microseconds */
954
934
return new Item_float(value, 6);
956
936
case SHOW_HA_ROWS:
959
LOCK_global_system_variables.lock();
939
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
960
940
value= *(ha_rows*) value_ptr(session, var_type, base);
961
LOCK_global_system_variables.unlock();
962
942
return new Item_int((uint64_t) value);
967
LOCK_global_system_variables.lock();
947
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
968
948
value= *(size_t*) value_ptr(session, var_type, base);
969
LOCK_global_system_variables.unlock();
970
950
return new Item_int((uint64_t) value);
972
952
case SHOW_MY_BOOL:
975
LOCK_global_system_variables.lock();
955
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
976
956
value= *(bool*) value_ptr(session, var_type, base);
977
LOCK_global_system_variables.unlock();
978
957
return new Item_int(value,1);
980
959
case SHOW_CHAR_PTR:
983
LOCK_global_system_variables.lock();
962
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
984
963
char *str= *(char**) value_ptr(session, var_type, base);
993
972
tmp= new Item_null();
994
973
tmp->collation.set(system_charset_info, DERIVATION_SYSCONST);
996
LOCK_global_system_variables.unlock();
1002
LOCK_global_system_variables.lock();
981
boost::mutex::scoped_lock scopedLock(session->catalog().systemVariableLock());
1003
982
char *str= (char*) value_ptr(session, var_type, base);
1005
984
tmp= new Item_string(str, strlen(str),
1090
1063
String str(buff,sizeof(buff), system_charset_info), *res;
1091
1064
if (!(res=var->value->val_str(&str)))
1093
my_error(ER_WRONG_VALUE_FOR_VAR, MYF(0), name.c_str(), "NULL");
1066
boost::throw_exception(invalid_option_value(var->var->getName()) << invalid_value(std::string("NULL")));
1096
1069
if (!(tmp=get_charset_by_name(res->c_ptr())))
1098
1071
my_error(ER_UNKNOWN_COLLATION, MYF(0), res->c_ptr());
1072
boost::throw_exception(invalid_option_value(var->var->getName()) << invalid_value(std::string(res->c_ptr())));
1107
1081
internal::int10_to_str((int) var->value->val_int(), buf, -10);
1108
1082
my_error(ER_UNKNOWN_COLLATION, MYF(0), buf);
1083
boost::throw_exception(invalid_option_value(var->var->getName()) << invalid_value(boost::lexical_cast<std::string>(var->value->val_int())));
1112
var->save_result.charset= tmp; // Save for update
1117
bool sys_var_collation_sv::update(Session *session, set_var *var)
1119
1087
if (var->type == OPT_GLOBAL)
1120
global_system_variables.*offset= var->save_result.charset;
1088
global_system_variables.*offset= tmp;
1123
session->variables.*offset= var->save_result.charset;
1091
session->variables.*offset= tmp;
1152
1120
bool sys_var_timestamp::update(Session *session, set_var *var)
1154
session->set_time((time_t) var->save_result.uint64_t_value);
1122
session->set_time(time_t(var->getInteger()));
1159
1127
void sys_var_timestamp::set_default(Session *session, sql_var_t)
1161
session->user_time=0;
1129
session->resetUserTime();
1165
1133
unsigned char *sys_var_timestamp::value_ptr(Session *session, sql_var_t,
1166
1134
const LEX_STRING *)
1168
session->sys_var_tmp.int32_t_value= (int32_t) session->start_time;
1136
session->sys_var_tmp.int32_t_value= (int32_t) session->getCurrentTimestampEpoch();
1169
1137
return (unsigned char*) &session->sys_var_tmp.int32_t_value;
1173
1141
bool sys_var_last_insert_id::update(Session *session, set_var *var)
1175
session->first_successful_insert_id_in_prev_stmt=
1176
var->save_result.uint64_t_value;
1143
session->first_successful_insert_id_in_prev_stmt= var->getInteger();
1191
1158
return (unsigned char*) &session->sys_var_tmp.uint64_t_value;
1195
bool sys_var_session_time_zone::check(Session *session, set_var *var)
1197
char buff[MAX_TIME_ZONE_NAME_LENGTH];
1198
String str(buff, sizeof(buff), &my_charset_utf8_general_ci);
1199
String *res= var->value->val_str(&str);
1201
if (!(var->save_result.time_zone= my_tz_find(session, res)))
1203
my_error(ER_UNKNOWN_TIME_ZONE, MYF(0), res ? res->c_ptr() : "NULL");
1210
bool sys_var_session_time_zone::update(Session *session, set_var *var)
1212
/* We are using Time_zone object found during check() phase. */
1213
if (var->type == OPT_GLOBAL)
1215
LOCK_global_system_variables.lock();
1216
global_system_variables.time_zone= var->save_result.time_zone;
1217
LOCK_global_system_variables.unlock();
1220
session->variables.time_zone= var->save_result.time_zone;
1225
unsigned char *sys_var_session_time_zone::value_ptr(Session *session,
1230
We can use ptr() instead of c_ptr() here because String contaning
1231
time zone name is guaranteed to be zero ended.
1233
if (type == OPT_GLOBAL)
1234
return (unsigned char *)(global_system_variables.time_zone->get_name()->ptr());
1238
This is an ugly fix for replication: we don't replicate properly queries
1239
invoking system variables' values to update tables; but
1240
CONVERT_TZ(,,@@session.time_zone) is so popular that we make it
1241
replicable (i.e. we tell the binlog code to store the session
1242
timezone). If it's the global value which was used we can't replicate
1243
(binlog code stores session value only).
1245
return (unsigned char *)(session->variables.time_zone->get_name()->ptr());
1250
void sys_var_session_time_zone::set_default(Session *session, sql_var_t type)
1252
LOCK_global_system_variables.lock();
1253
if (type == OPT_GLOBAL)
1255
if (default_tz_name)
1257
String str(default_tz_name, &my_charset_utf8_general_ci);
1259
We are guaranteed to find this time zone since its existence
1260
is checked during start-up.
1262
global_system_variables.time_zone= my_tz_find(session, &str);
1265
global_system_variables.time_zone= my_tz_SYSTEM;
1268
session->variables.time_zone= global_system_variables.time_zone;
1269
LOCK_global_system_variables.unlock();
1273
bool sys_var_session_lc_time_names::check(Session *, set_var *var)
1161
bool sys_var_session_lc_time_names::update(Session *session, set_var *var)
1275
1163
MY_LOCALE *locale_match;
1396
1275
static bool set_option_autocommit(Session *session, set_var *var)
1398
1278
/* The test is negative as the flag we use is NOT autocommit */
1400
1280
uint64_t org_options= session->options;
1281
uint64_t new_options= session->options;
1402
if (var->save_result.uint32_t_value != 0)
1403
session->options&= ~((sys_var_session_bit*) var->var)->bit_flag;
1283
if (var->getInteger() != 0)
1284
new_options&= ~((sys_var_session_bit*) var->var)->bit_flag;
1405
session->options|= ((sys_var_session_bit*) var->var)->bit_flag;
1286
new_options|= ((sys_var_session_bit*) var->var)->bit_flag;
1407
if ((org_options ^ session->options) & OPTION_NOT_AUTOCOMMIT)
1288
if ((org_options ^ new_options) & OPTION_NOT_AUTOCOMMIT)
1409
1290
if ((org_options & OPTION_NOT_AUTOCOMMIT))
1292
success= session->endActiveTransaction();
1411
1293
/* We changed to auto_commit mode */
1412
1294
session->options&= ~(uint64_t) (OPTION_BEGIN);
1413
1295
session->server_status|= SERVER_STATUS_AUTOCOMMIT;
1414
TransactionServices &transaction_services= TransactionServices::singleton();
1415
if (transaction_services.commitTransaction(session, true))
1420
1299
session->server_status&= ~SERVER_STATUS_AUTOCOMMIT;
1303
if (var->getInteger() != 0)
1304
session->options&= ~((sys_var_session_bit*) var->var)->bit_flag;
1306
session->options|= ((sys_var_session_bit*) var->var)->bit_flag;
1426
1314
static int check_pseudo_thread_id(Session *, set_var *var)
1428
var->save_result.uint64_t_value= var->value->val_int();
1614
1502
add_sys_var_to_list(&sys_last_insert_id, my_long_options);
1615
1503
add_sys_var_to_list(&sys_lc_time_names, my_long_options);
1616
1504
add_sys_var_to_list(&sys_max_allowed_packet, my_long_options);
1617
add_sys_var_to_list(&sys_max_connect_errors, my_long_options);
1618
1505
add_sys_var_to_list(&sys_max_error_count, my_long_options);
1619
1506
add_sys_var_to_list(&sys_max_heap_table_size, my_long_options);
1620
1507
add_sys_var_to_list(&sys_max_join_size, my_long_options);
1643
1530
add_sys_var_to_list(&sys_sql_notes, my_long_options);
1644
1531
add_sys_var_to_list(&sys_sql_warnings, my_long_options);
1645
1532
add_sys_var_to_list(&sys_storage_engine, my_long_options);
1646
add_sys_var_to_list(&sys_system_time_zone, my_long_options);
1647
1533
add_sys_var_to_list(&sys_table_cache_size, my_long_options);
1648
1534
add_sys_var_to_list(&sys_table_def_size, my_long_options);
1649
1535
add_sys_var_to_list(&sys_table_lock_wait_timeout, my_long_options);
1650
1536
add_sys_var_to_list(&sys_thread_stack_size, my_long_options);
1651
add_sys_var_to_list(&sys_time_zone, my_long_options);
1652
1537
add_sys_var_to_list(&sys_timed_mutexes, my_long_options);
1653
1538
add_sys_var_to_list(&sys_timestamp, my_long_options);
1654
1539
add_sys_var_to_list(&sys_tmp_table_size, my_long_options);
1725
1596
Functions to handle table_type
1726
1597
****************************************************************************/
1728
/* Based upon sys_var::check_enum() */
1730
bool sys_var_session_storage_engine::check(Session *session, set_var *var)
1732
char buff[STRING_BUFFER_USUAL_SIZE];
1734
String str(buff, sizeof(buff), &my_charset_utf8_general_ci), *res;
1736
var->save_result.storage_engine= NULL;
1737
if (var->value->result_type() == STRING_RESULT)
1739
res= var->value->val_str(&str);
1740
if (res == NULL || res->ptr() == NULL)
1747
const std::string engine_name(res->ptr());
1748
plugin::StorageEngine *engine;
1749
var->save_result.storage_engine= plugin::StorageEngine::findByName(*session, engine_name);
1750
if (var->save_result.storage_engine == NULL)
1752
value= res->c_ptr();
1755
engine= var->save_result.storage_engine;
1762
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), value);
1767
1599
unsigned char *sys_var_session_storage_engine::value_ptr(Session *session,
1768
1600
sql_var_t type,
1769
1601
const LEX_STRING *)
1802
1634
bool sys_var_session_storage_engine::update(Session *session, set_var *var)
1804
plugin::StorageEngine **value= &(global_system_variables.*offset), *old_value;
1636
char buff[STRING_BUFFER_USUAL_SIZE];
1637
const char *name_value;
1638
String str(buff, sizeof(buff), &my_charset_utf8_general_ci), *res;
1640
plugin::StorageEngine *tmp= NULL;
1641
plugin::StorageEngine **value= NULL;
1643
if (var->value->result_type() == STRING_RESULT)
1645
res= var->value->val_str(&str);
1646
if (res == NULL || res->ptr() == NULL)
1653
const std::string engine_name(res->ptr());
1654
tmp= plugin::StorageEngine::findByName(*session, engine_name);
1657
name_value= res->c_ptr();
1664
name_value= "unknown";
1667
value= &(global_system_variables.*offset);
1805
1668
if (var->type != OPT_GLOBAL)
1806
1669
value= &(session->variables.*offset);
1808
if (old_value != var->save_result.storage_engine)
1810
*value= var->save_result.storage_engine;
1676
my_error(ER_UNKNOWN_STORAGE_ENGINE, MYF(0), name_value);
1815
1680
} /* namespace drizzled */