| 325 | } |
| 326 | |
| 327 | static bool has_no_default_value(THD *thd, Field *field, TABLE_LIST *table_list) |
| 328 | { |
| 329 | if ((field->flags & (NO_DEFAULT_VALUE_FLAG | VERS_ROW_START | VERS_ROW_END)) |
| 330 | == NO_DEFAULT_VALUE_FLAG && field->real_type() != MYSQL_TYPE_ENUM) |
| 331 | { |
| 332 | bool view= false; |
| 333 | if (table_list) |
| 334 | { |
| 335 | table_list= table_list->top_table(); |
| 336 | view= table_list->view != NULL; |
| 337 | } |
| 338 | if (view) |
| 339 | { |
| 340 | push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_NO_DEFAULT_FOR_VIEW_FIELD, |
| 341 | ER_THD(thd, ER_NO_DEFAULT_FOR_VIEW_FIELD), |
| 342 | table_list->view_db.str, table_list->view_name.str); |
| 343 | } |
| 344 | else |
| 345 | { |
| 346 | push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN, ER_NO_DEFAULT_FOR_FIELD, |
| 347 | ER_THD(thd, ER_NO_DEFAULT_FOR_FIELD), |
| 348 | field->field_name.str); |
| 349 | } |
| 350 | return thd->really_abort_on_warning(); |
| 351 | } |
| 352 | return false; |
| 353 | } |
| 354 | |
| 355 | |
| 356 | /** |
no test coverage detected