156
157
if (var->getAfterUpdateTrigger())
157
158
(*var->getAfterUpdateTrigger())(session, type);
159
catch (boost::exception &)
160
catch (invalid_option_value &ex)
161
162
/* TODO: Fix this to be typesafe once we have properly typed set_var */
162
163
string new_val= boost::lexical_cast<string>(save_result.uint32_t_value);
163
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
164
ER_TRUNCATED_WRONG_VALUE,
165
ER(ER_TRUNCATED_WRONG_VALUE), var->getName().c_str(),
164
if (boost::get_error_info<invalid_max_info>(ex) != NULL)
166
const uint64_t max_val= *(boost::get_error_info<invalid_max_info>(ex));
167
string explanation("(> ");
168
explanation.append(boost::lexical_cast<std::string>(max_val));
169
explanation.push_back(')');
170
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
171
ER_INVALID_OPTION_VALUE,
172
ER(ER_INVALID_OPTION_VALUE),
173
var->getName().c_str(),
175
explanation.c_str());
177
else if (boost::get_error_info<invalid_min_info>(ex) != NULL)
179
const int64_t min_val= *(boost::get_error_info<invalid_min_info>(ex));
180
string explanation("(< ");
181
explanation.append(boost::lexical_cast<std::string>(min_val));
182
explanation.push_back(')');
183
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
184
ER_INVALID_OPTION_VALUE,
185
ER(ER_INVALID_OPTION_VALUE),
186
var->getName().c_str(),
188
explanation.c_str());
192
push_warning_printf(session, DRIZZLE_ERROR::WARN_LEVEL_ERROR,
193
ER_INVALID_OPTION_VALUE,
194
ER(ER_INVALID_OPTION_VALUE),
195
var->getName().c_str(),