mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Merge from Tim's 5.0.76-release tree to make 5.0.77 .
This commit is contained in:
@ -798,7 +798,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
|
||||
{
|
||||
bool has_default;
|
||||
bool has_now_default;
|
||||
|
||||
enum enum_field_types field_type= field->type();
|
||||
/*
|
||||
We are using CURRENT_TIMESTAMP instead of NOW because it is
|
||||
more standard
|
||||
@ -806,7 +806,7 @@ static bool get_field_default_value(THD *thd, TABLE *table,
|
||||
has_now_default= table->timestamp_field == field &&
|
||||
field->unireg_check != Field::TIMESTAMP_UN_FIELD;
|
||||
|
||||
has_default= (field->type() != FIELD_TYPE_BLOB &&
|
||||
has_default= (field_type != FIELD_TYPE_BLOB &&
|
||||
!(field->flags & NO_DEFAULT_VALUE_FLAG) &&
|
||||
field->unireg_check != Field::NEXT_NUMBER &&
|
||||
!((thd->variables.sql_mode & (MODE_MYSQL323 | MODE_MYSQL40))
|
||||
@ -821,7 +821,19 @@ static bool get_field_default_value(THD *thd, TABLE *table,
|
||||
{ // Not null by default
|
||||
char tmp[MAX_FIELD_WIDTH];
|
||||
String type(tmp, sizeof(tmp), field->charset());
|
||||
field->val_str(&type);
|
||||
if (field_type == MYSQL_TYPE_BIT)
|
||||
{
|
||||
longlong dec= field->val_int();
|
||||
char *ptr= longlong2str(dec, tmp + 2, 2);
|
||||
uint32 length= (uint32) (ptr - tmp);
|
||||
tmp[0]= 'b';
|
||||
tmp[1]= '\'';
|
||||
tmp[length]= '\'';
|
||||
type.length(length + 1);
|
||||
quoted= 0;
|
||||
}
|
||||
else
|
||||
field->val_str(&type);
|
||||
if (type.length())
|
||||
{
|
||||
String def_val;
|
||||
@ -1525,6 +1537,8 @@ static bool show_status_array(THD *thd, const char *wild,
|
||||
case SHOW_FLUSHTIME:
|
||||
nr= (long) (thd->query_start() - flush_status_time);
|
||||
end= int10_to_str(nr, buff, 10);
|
||||
case SHOW_QUERIES:
|
||||
end= int10_to_str((long) thd->query_id, buff, 10);
|
||||
break;
|
||||
#ifdef HAVE_REPLICATION
|
||||
case SHOW_RPL_STATUS:
|
||||
|
Reference in New Issue
Block a user