Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet@stripped, 2006-08-01 20:24:30+02:00, msvensson@neptunus.(none) +19 -0
Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
MERGE: 1.2196.1.53
client/mysql.cc@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.208.1.3
client/mysqldump.c@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.234.1.1
configure.in@stripped, 2006-08-01 20:24:24+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.392.1.14
mysql-test/mysql-test-run.pl@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.104.1.1
mysql-test/r/date_formats.result@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.23.1.1
mysql-test/r/federated.result@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.33.1.1
mysql-test/r/func_time.result@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.61.1.1
mysql-test/r/mysql.result@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.10.1.2
mysql-test/r/type_ranges.result@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.39.1.1
mysql-test/t/func_time.test@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.49.1.1
mysql-test/t/mysql.test@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.10.1.2
sql/field.cc@stripped, 2006-08-01 20:24:25+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.314.1.1
sql/item_strfunc.cc@stripped, 2006-08-01 20:24:26+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.275.1.2
sql/item_strfunc.h@stripped, 2006-08-01 20:24:26+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.109.1.1
sql/item_subselect.cc@stripped, 2006-08-01 20:24:26+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.126.1.1
sql/item_timefunc.cc@stripped, 2006-08-01 20:24:26+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.119.1.1
sql/mysqld.cc@stripped, 2006-08-01 20:24:26+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.560.1.1
sql/sql_class.h@stripped, 2006-08-01 20:24:26+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.288.1.8
sql/sql_yacc.yy@stripped, 2006-08-01 20:24:27+02:00, msvensson@neptunus.(none) +0 -0
Auto merged
MERGE: 1.474.1.1
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.0-maint/RESYNC
--- 1.209/client/mysql.cc 2006-08-01 20:24:36 +02:00
+++ 1.210/client/mysql.cc 2006-08-01 20:24:36 +02:00
@@ -2858,7 +2858,7 @@ com_connect(String *buffer, char *line)
bzero(buff, sizeof(buff));
if (buffer)
{
- strmov(buff, line);
+ strmake(buff, line, sizeof(buff));
tmp= get_arg(buff, 0);
if (tmp && *tmp)
{
@@ -3723,6 +3723,9 @@ static const char* construct_prompt()
break;
case 't':
processed_prompt.append('\t');
+ break;
+ case 'l':
+ processed_prompt.append(delimiter_str);
break;
default:
processed_prompt.append(c);
--- 1.235/client/mysqldump.c 2006-08-01 20:24:36 +02:00
+++ 1.236/client/mysqldump.c 2006-08-01 20:24:36 +02:00
@@ -565,6 +565,13 @@ static void write_footer(FILE *sql_file)
fprintf(sql_file,
"/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;\n");
fputs("\n", sql_file);
+ if (opt_comments)
+ {
+ char time_str[20];
+ get_date(time_str, GETDATE_DATE_TIME, 0);
+ fprintf(sql_file, "-- Dump completed on %s\n",
+ time_str);
+ }
check_io(sql_file);
}
} /* write_footer */
--- 1.394/configure.in 2006-08-01 20:24:36 +02:00
+++ 1.395/configure.in 2006-08-01 20:24:36 +02:00
@@ -2342,12 +2342,16 @@ then
man_dirs="man"
man1_files=`ls -1 $srcdir/man/*.1 | sed -e 's;^.*man/;;'`
man1_files=`echo $man1_files`
+ man8_files=`ls -1 $srcdir/man/*.8 | sed -e 's;^.*man/;;'`
+ man8_files=`echo $man8_files`
else
man_dirs=""
man1_files=""
+ man8_files=""
fi
AC_SUBST(man_dirs)
AC_SUBST(man1_files)
+AC_SUBST(man8_files)
# Shall we build the bench code?
AC_ARG_WITH(bench,
--- 1.318/sql/field.cc 2006-08-01 20:24:36 +02:00
+++ 1.319/sql/field.cc 2006-08-01 20:24:36 +02:00
@@ -8265,7 +8265,8 @@ bool create_field::init(THD *thd, char *
comment= *fld_comment;
/*
- Set flag if this field doesn't have a default value
+ Set NO_DEFAULT_VALUE_FLAG if this field doesn't have a default value and
+ it is NOT NULL, not an AUTO_INCREMENT field and not a TIMESTAMP.
*/
if (!fld_default_value && !(fld_type_modifier & AUTO_INCREMENT_FLAG) &&
(fld_type_modifier & NOT_NULL_FLAG) && fld_type != FIELD_TYPE_TIMESTAMP)
@@ -8342,11 +8343,27 @@ bool create_field::init(THD *thd, char *
/* Allow empty as default value. */
String str,*res;
res= fld_default_value->val_str(&str);
- if (res->length())
+ /*
+ A default other than '' is always an error, and any non-NULL
+ specified default is an error in strict mode.
+ */
+ if (res->length() || (thd->variables.sql_mode &
+ (MODE_STRICT_TRANS_TABLES |
+ MODE_STRICT_ALL_TABLES)))
{
my_error(ER_BLOB_CANT_HAVE_DEFAULT, MYF(0),
fld_name); /* purecov: inspected */
DBUG_RETURN(TRUE);
+ }
+ else
+ {
+ /*
+ Otherwise a default of '' is just a warning.
+ */
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_WARN,
+ ER_BLOB_CANT_HAVE_DEFAULT,
+ ER(ER_BLOB_CANT_HAVE_DEFAULT),
+ fld_name);
}
def= 0;
}
--- 1.276/sql/item_strfunc.cc 2006-08-01 20:24:36 +02:00
+++ 1.277/sql/item_strfunc.cc 2006-08-01 20:24:36 +02:00
@@ -752,44 +752,47 @@ String *Item_func_reverse::val_str(Strin
{
DBUG_ASSERT(fixed == 1);
String *res = args[0]->val_str(str);
- char *ptr,*end;
+ char *ptr, *end, *tmp;
if ((null_value=args[0]->null_value))
return 0;
/* An empty string is a special case as the string pointer may be null */
if (!res->length())
return &my_empty_string;
- res=copy_if_not_alloced(str,res,res->length());
- ptr = (char *) res->ptr();
- end=ptr+res->length();
+ if (tmp_value.alloced_length() < res->length() &&
+ tmp_value.realloc(res->length()))
+ {
+ null_value= 1;
+ return 0;
+ }
+ tmp_value.length(res->length());
+ tmp_value.set_charset(res->charset());
+ ptr= (char *) res->ptr();
+ end= ptr + res->length();
+ tmp= (char *) tmp_value.ptr() + tmp_value.length();
#ifdef USE_MB
if (use_mb(res->charset()))
{
- String tmpstr;
- tmpstr.copy(*res);
- char *tmp = (char *) tmpstr.ptr() + tmpstr.length();
register uint32 l;
while (ptr < end)
{
- if ((l=my_ismbchar(res->charset(), ptr,end)))
- tmp-=l, memcpy(tmp,ptr,l), ptr+=l;
+ if ((l= my_ismbchar(res->charset(),ptr,end)))
+ {
+ tmp-= l;
+ memcpy(tmp,ptr,l);
+ ptr+= l;
+ }
else
- *--tmp=*ptr++;
+ *--tmp= *ptr++;
}
- memcpy((char *) res->ptr(),(char *) tmpstr.ptr(), res->length());
}
else
#endif /* USE_MB */
{
- char tmp;
while (ptr < end)
- {
- tmp=*ptr;
- *ptr++=*--end;
- *end=tmp;
- }
+ *--tmp= *ptr++;
}
- return res;
+ return &tmp_value;
}
--- 1.110/sql/item_strfunc.h 2006-08-01 20:24:36 +02:00
+++ 1.111/sql/item_strfunc.h 2006-08-01 20:24:36 +02:00
@@ -804,7 +804,7 @@ class Item_func_uncompress: public Item_
String buffer;
public:
Item_func_uncompress(Item *a): Item_str_func(a){}
- void fix_length_and_dec(){max_length= MAX_BLOB_WIDTH;}
+ void fix_length_and_dec(){ maybe_null= 1; max_length= MAX_BLOB_WIDTH; }
const char *func_name() const{return "uncompress";}
String *val_str(String *) ZLIB_DEPENDED_FUNCTION
};
--- 1.120/sql/item_timefunc.cc 2006-08-01 20:24:36 +02:00
+++ 1.121/sql/item_timefunc.cc 2006-08-01 20:24:36 +02:00
@@ -2877,6 +2877,8 @@ longlong Item_func_timestamp_diff::val_i
{
uint year_beg, year_end, month_beg, month_end, day_beg, day_end;
uint years= 0;
+ uint second_beg, second_end, microsecond_beg, microsecond_end;
+
if (neg == -1)
{
year_beg= ltime2.year;
@@ -2885,6 +2887,10 @@ longlong Item_func_timestamp_diff::val_i
month_end= ltime1.month;
day_beg= ltime2.day;
day_end= ltime1.day;
+ second_beg= ltime2.hour * 3600 + ltime2.minute * 60 + ltime2.second;
+ second_end= ltime1.hour * 3600 + ltime1.minute * 60 + ltime1.second;
+ microsecond_beg= ltime2.second_part;
+ microsecond_end= ltime1.second_part;
}
else
{
@@ -2894,6 +2900,10 @@ longlong Item_func_timestamp_diff::val_i
month_end= ltime2.month;
day_beg= ltime1.day;
day_end= ltime2.day;
+ second_beg= ltime1.hour * 3600 + ltime1.minute * 60 + ltime1.second;
+ second_end= ltime2.hour * 3600 + ltime2.minute * 60 + ltime2.second;
+ microsecond_beg= ltime1.second_part;
+ microsecond_end= ltime2.second_part;
}
/* calc years */
@@ -2907,7 +2917,12 @@ longlong Item_func_timestamp_diff::val_i
months+= 12 - (month_beg - month_end);
else
months+= (month_end - month_beg);
+
if (day_end < day_beg)
+ months-= 1;
+ else if ((day_end == day_beg) &&
+ ((second_end < second_beg) ||
+ (second_end == second_beg && microsecond_end < microsecond_beg)))
months-= 1;
}
--- 1.563/sql/mysqld.cc 2006-08-01 20:24:36 +02:00
+++ 1.564/sql/mysqld.cc 2006-08-01 20:24:37 +02:00
@@ -2770,6 +2770,11 @@ You should consider changing lower_case_
mysql_real_data_home);
lower_case_table_names= 0;
}
+ else
+ {
+ lower_case_file_system=
+ (test_if_case_insensitive(mysql_real_data_home) == 1);
+ }
/* Reset table_alias_charset, now that lower_case_table_names is set. */
table_alias_charset= (lower_case_table_names ?
--- 1.290/sql/sql_class.h 2006-08-01 20:24:37 +02:00
+++ 1.291/sql/sql_class.h 2006-08-01 20:24:37 +02:00
@@ -41,6 +41,7 @@ enum enum_check_fields { CHECK_FIELD_IGN
CHECK_FIELD_ERROR_FOR_NULL };
extern char internal_table_name[2];
+extern char empty_c_string[1];
extern const char **errmesg;
#define TC_LOG_PAGE_SIZE 8192
@@ -1324,6 +1325,8 @@ public:
bool no_errors, password, is_fatal_error;
bool query_start_used, rand_used, time_zone_used;
bool last_insert_id_used,insert_id_used, clear_next_insert_id;
+ /* for IS NULL => = last_insert_id() fix in remove_eq_conds() */
+ bool substitute_null_with_insert_id;
bool in_lock_tables;
bool query_error, bootstrap, cleanup_done;
bool tmp_table_used;
@@ -1455,6 +1458,7 @@ public:
{
last_insert_id= id_arg;
insert_id_used=1;
+ substitute_null_with_insert_id= TRUE;
}
inline ulonglong insert_id(void)
{
@@ -1980,11 +1984,21 @@ public:
{
db.str=0;
}
+ /*
+ This constructor is used only for the case when we create a derived
+ table. A derived table has no name and doesn't belong to any database.
+ Later, if there was an alias specified for the table, it will be set
+ by add_table_to_list.
+ */
inline Table_ident(SELECT_LEX_UNIT *s) : sel(s)
{
/* We must have a table name here as this is used with add_table_to_list */
- db.str=0; table.str= internal_table_name; table.length=1;
+ db.str= empty_c_string; /* a subject to casedn_str */
+ db.length= 0;
+ table.str= internal_table_name;
+ table.length=1;
}
+ bool is_derived_table() const { return test(sel); }
inline void change_db(char *db_name)
{
db.str= db_name; db.length= (uint) strlen(db_name);
--- 1.475/sql/sql_yacc.yy 2006-08-01 20:24:37 +02:00
+++ 1.476/sql/sql_yacc.yy 2006-08-01 20:24:37 +02:00
@@ -4060,8 +4060,8 @@ select_item:
YYABORT;
if ($4.str)
{
- $2->set_name($4.str, $4.length, system_charset_info);
$2->is_autogenerated_name= FALSE;
+ $2->set_name($4.str, $4.length, system_charset_info);
}
else if (!$2->name) {
char *str = $1;
@@ -4936,8 +4936,8 @@ udf_expr:
{
if ($4.str)
{
- $2->set_name($4.str, $4.length, system_charset_info);
$2->is_autogenerated_name= FALSE;
+ $2->set_name($4.str, $4.length, system_charset_info);
}
else
$2->set_name($1, (uint) ($3 - $1), YYTHD->charset());
--- 1.127/sql/item_subselect.cc 2006-08-01 20:24:37 +02:00
+++ 1.128/sql/item_subselect.cc 2006-08-01 20:24:37 +02:00
@@ -1511,6 +1511,7 @@ static Item_result set_row(List<Item> &i
item->max_length= sel_item->max_length;
res_type= sel_item->result_type();
item->decimals= sel_item->decimals;
+ item->unsigned_flag= sel_item->unsigned_flag;
*maybe_null= sel_item->maybe_null;
if (!(row[i]= Item_cache::get_cache(res_type)))
return STRING_RESULT; // we should return something
--- 1.25/mysql-test/r/date_formats.result 2006-08-01 20:24:37 +02:00
+++ 1.26/mysql-test/r/date_formats.result 2006-08-01 20:24:37 +02:00
@@ -449,6 +449,8 @@ create table t1 select str_to_date("2003
str_to_date("10:11:12.0012", "%H:%i:%S.%f") as f2,
str_to_date("2003-01-02", "%Y-%m-%d") as f3,
str_to_date("02", "%d") as f4, str_to_date("02 10", "%d %H") as f5;
+Warnings:
+Warning 1265 Data truncated for column 'f4' at row 1
describe t1;
Field Type Null Key Default Extra
f1 datetime YES NULL
@@ -458,7 +460,7 @@ f4 date YES NULL
f5 time YES NULL
select * from t1;
f1 f2 f3 f4 f5
-2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-02 58:00:00
+2003-01-02 10:11:12 10:11:12 2003-01-02 0000-00-00 58:00:00
drop table t1;
create table t1 select "02 10" as a, "%d %H" as b;
select str_to_date(a,b) from t1;
--- 1.62/mysql-test/r/func_time.result 2006-08-01 20:24:37 +02:00
+++ 1.63/mysql-test/r/func_time.result 2006-08-01 20:24:37 +02:00
@@ -667,6 +667,78 @@ timestampdiff(SQL_TSI_DAY, '1996-02-01',
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
a1 a2 a3 a4
28 28 29 29
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27');
+TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27')
+0
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28');
+TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28')
+1
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29');
+TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29')
+1
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27');
+TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27')
+1
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28');
+TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28')
+2
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29');
+TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29')
+2
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27');
+TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27')
+0
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28');
+TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28')
+1
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29');
+TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29')
+1
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27');
+TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27')
+1
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28');
+TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28')
+2
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29');
+TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29')
+2
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27');
+TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27')
+0
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28');
+TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28')
+1
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29');
+TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29')
+1
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27');
+TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27')
+1
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28');
+TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28')
+2
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29');
+TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29')
+2
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27');
+TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27')
+0
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28');
+TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28')
+1
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29');
+TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29')
+1
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27');
+TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27')
+1
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28');
+TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28')
+2
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29');
+TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29')
+2
select date_add(time,INTERVAL 1 SECOND) from t1;
date_add(time,INTERVAL 1 SECOND)
NULL
--- 1.40/mysql-test/r/type_ranges.result 2006-08-01 20:24:37 +02:00
+++ 1.41/mysql-test/r/type_ranges.result 2006-08-01 20:24:37 +02:00
@@ -38,6 +38,9 @@ KEY (ulong),
KEY (ulonglong,ulong),
KEY (options,flags)
);
+Warnings:
+Warning 1101 BLOB/TEXT column 'mediumblob_col' can't have a default value
+Warning 1101 BLOB/TEXT column 'longblob_col' can't have a default value
show full fields from t1;
Field Type Collation Null Key Default Extra Privileges Comment
auto int(5) unsigned NULL NO PRI NULL auto_increment #
--- 1.50/mysql-test/t/func_time.test 2006-08-01 20:24:37 +02:00
+++ 1.51/mysql-test/t/func_time.test 2006-08-01 20:24:37 +02:00
@@ -318,6 +318,37 @@ select timestampdiff(SQL_TSI_DAY, '1986-
timestampdiff(SQL_TSI_DAY, '1996-02-01', '1996-03-01') as a3,
timestampdiff(SQL_TSI_DAY, '2000-02-01', '2000-03-01') as a4;
+# bug 16226
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:27');
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:28');
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-11 14:30:29');
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:27');
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:28');
+SELECT TIMESTAMPDIFF(day,'2006-01-10 14:30:28','2006-01-12 14:30:29');
+
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:27');
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:28');
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-17 14:30:29');
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:27');
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:28');
+SELECT TIMESTAMPDIFF(week,'2006-01-10 14:30:28','2006-01-24 14:30:29');
+
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:27');
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:28');
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-02-10 14:30:29');
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:27');
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:28');
+SELECT TIMESTAMPDIFF(month,'2006-01-10 14:30:28','2006-03-10 14:30:29');
+
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:27');
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:28');
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2007-01-10 14:30:29');
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:27');
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:28');
+SELECT TIMESTAMPDIFF(year,'2006-01-10 14:30:28','2008-01-10 14:30:29');
+
+# end of bug
+
select date_add(time,INTERVAL 1 SECOND) from t1;
drop table t1;
--- 1.11/mysql-test/r/mysql.result 2006-08-01 20:24:37 +02:00
+++ 1.12/mysql-test/r/mysql.result 2006-08-01 20:24:37 +02:00
@@ -104,4 +104,15 @@ c_cp932
| 2 | NULL |
| 3 | |
+------+------+
+create table t1(a int, b varchar(255), c int);
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b varchar(255) YES NULL
+c int(11) YES NULL
+Field Type Null Key Default Extra
+a int(11) YES NULL
+b varchar(255) YES NULL
+c int(11) YES NULL
+drop table t1;
+ERROR 1049 (42000) at line 1: Unknown database 'verylongdatabasenamethatshouldblowthe256byteslongbufferincom_con'
End of 5.0 tests
--- 1.11/mysql-test/t/mysql.test 2006-08-01 20:24:37 +02:00
+++ 1.12/mysql-test/t/mysql.test 2006-08-01 20:24:37 +02:00
@@ -77,6 +77,21 @@ drop table t1;
#
--exec $MYSQL -t test -e "create table b19564 (i int, s1 char(1)); insert into b19564 values (1, 'x'); insert into b19564 values (2, NULL); insert into b19564 values (3, ' '); select * from b19564 order by i; drop table b19564;"
+#
+# Bug#19265 describe command does not work from mysql prompt
+#
+
+create table t1(a int, b varchar(255), c int);
+--exec $MYSQL test -e "desc t1"
+--exec $MYSQL test -e "desc t1\g"
+drop table t1;
+
+#
+# Bug#21042 mysql client segfaults on importing a mysqldump export
+#
+--error 1
+--exec $MYSQL test -e "connect verylongdatabasenamethatshouldblowthe256byteslongbufferincom_connectfunctionxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxkxendcccccccdxxxxxxxxxxxxxxxxxkskskskskkskskskskskskskskskskkskskskskkskskskskskskskskskend" 2>&1
+
--echo End of 5.0 tests
--- 1.36/mysql-test/r/federated.result 2006-08-01 20:24:37 +02:00
+++ 1.37/mysql-test/r/federated.result 2006-08-01 20:24:37 +02:00
@@ -967,6 +967,8 @@ CREATE TABLE federated.t1 (
`blurb` text default '',
PRIMARY KEY (blurb_id))
DEFAULT CHARSET=latin1;
+Warnings:
+Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`blurb_id` int NOT NULL DEFAULT 0,
@@ -975,6 +977,8 @@ PRIMARY KEY (blurb_id))
ENGINE="FEDERATED"
DEFAULT CHARSET=latin1
CONNECTION='mysql://root@stripped:SLAVE_PORT/federated/t1';
+Warnings:
+Warning 1101 BLOB/TEXT column 'blurb' can't have a default value
INSERT INTO federated.t1 VALUES (1, " MySQL supports a number of column types in several categories: numeric types, date and time types, and string (character) types. This chapter first gives an overview of these column types, and then provides a more detailed description of the properties of the types in each category, and a summary of the column type storage requirements. The overview is intentionally brief. The more detailed descriptions should be consulted for additional information about particular column types, such as the allowable formats in which you can specify values.");
INSERT INTO federated.t1 VALUES (2, "All arithmetic is done using signed BIGINT or DOUBLE values, so you should not use unsigned big integers larger than 9223372036854775807 (63 bits) except with bit functions! If you do that, some of the last digits in the result may be wrong because of rounding errors when converting a BIGINT value to a DOUBLE.");
INSERT INTO federated.t1 VALUES (3, " A floating-point number. p represents the precision. It can be from 0 to 24 for a single-precision floating-point number and from 25 to 53 for a double-precision floating-point number. These types are like the FLOAT and DOUBLE types described immediately following. FLOAT(p) has the same range as the corresponding FLOAT and DOUBLE types, but the display size and number of decimals are undefined. ");
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.2227) | msvensson | 1 Aug |