Below is the list of changes that have just been committed into a local
5.1 repository of alik. When alik 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-11-07 16:24:35+03:00, anozdrin@alik. +31 -0
Merge alik.:/mnt/raid/alik/MySQL/devel/5.1
into alik.:/mnt/raid/alik/MySQL/devel/5.1-rt-merged-2
MERGE: 1.2334.2.5
configure.in@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.385.1.5
include/my_time.h@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.16.1.1
mysql-test/mysql-test-run.pl@stripped, 2006-11-07 16:24:33+03:00, anozdrin@alik. +6 -18
Manually merged.
MERGE: 1.183.4.4
mysql-test/r/func_time.result@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.81.1.1
mysql-test/r/kill.result@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.14.1.1
mysql-test/r/ps.result@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.77.1.9
mysql-test/r/rename.result@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.12.1.2
mysql-test/r/view.result@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.190.1.2
mysql-test/t/func_time.test@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.66.1.1
mysql-test/t/ps.test@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.74.2.7
mysql-test/t/rename.test@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -3
Auto merged
MERGE: 1.13.1.1
mysql-test/t/view.test@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.172.1.2
sql-common/my_time.c@stripped, 2006-11-07 16:13:27+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.22.1.1
sql/Makefile.am@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.162.1.1
sql/handler.cc@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.273.1.8
sql/item_timefunc.cc@stripped, 2006-11-07 16:13:25+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.137.1.2
sql/lex.h@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.164.1.1
sql/log.cc@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.237.1.5
sql/mysql_priv.h@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.448.1.9
sql/mysqld.cc@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.584.2.2
sql/sql_class.h@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.320.1.6
sql/sql_insert.cc@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.230.1.6
sql/sql_lex.cc@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.205.1.2
sql/sql_lex.h@stripped, 2006-11-07 16:13:26+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.245.1.5
sql/sql_parse.cc@stripped, 2006-11-07 16:24:33+03:00, anozdrin@alik. +0 -1
Manually merged.
MERGE: 1.585.1.7
sql/sql_select.cc@stripped, 2006-11-07 16:13:27+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.452.1.11
sql/sql_view.cc@stripped, 2006-11-07 16:13:27+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.110.1.3
sql/sql_yacc.yy@stripped, 2006-11-07 16:13:27+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.511.1.2
sql/table.cc@stripped, 2006-11-07 16:13:27+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.246.1.4
sql/time.cc@stripped, 2006-11-07 16:13:27+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.67.2.1
tests/mysql_client_test.c@stripped, 2006-11-07 16:13:28+03:00, anozdrin@alik. +0 -0
Auto merged
MERGE: 1.217.1.3
# 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: anozdrin
# Host: alik.
# Root: /mnt/raid/alik/MySQL/devel/5.1-rt-merged-2/RESYNC
--- 1.392/configure.in 2006-11-07 16:24:42 +03:00
+++ 1.393/configure.in 2006-11-07 16:24:42 +03:00
@@ -1712,6 +1712,13 @@ then
AC_MSG_ERROR("MySQL needs a off_t type.")
fi
+dnl
+dnl check if time_t is unsigned
+dnl
+
+MYSQL_CHECK_TIME_T
+
+
# do we need #pragma interface/#pragma implementation ?
# yes if it's gcc 2.x, and not icc pretending to be gcc, and not cygwin
AC_MSG_CHECKING(the need for @%:@pragma interface/implementation)
--- 1.163/sql/Makefile.am 2006-11-07 16:24:42 +03:00
+++ 1.164/sql/Makefile.am 2006-11-07 16:24:42 +03:00
@@ -30,12 +30,13 @@ libexec_PROGRAMS = mysqld
noinst_PROGRAMS = gen_lex_hash
bin_PROGRAMS = mysql_tzinfo_to_sql
gen_lex_hash_LDFLAGS = @NOINST_LDFLAGS@
-LDADD = $(top_builddir)/vio/libvio.a \
+SUPPORTING_LIBS = $(top_builddir)/vio/libvio.a \
$(top_builddir)/mysys/libmysys.a \
$(top_builddir)/dbug/libdbug.a \
$(top_builddir)/regex/libregex.a \
- $(top_builddir)/strings/libmystrings.a @ZLIB_LIBS@
-mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(LDADD)
+ $(top_builddir)/strings/libmystrings.a
+mysqld_DEPENDENCIES= @mysql_plugin_libs@ $(SUPPORTING_LIBS)
+LDADD = $(SUPPORTING_LIBS) @ZLIB_LIBS@
mysqld_LDADD = @MYSQLD_EXTRA_LDFLAGS@ \
@pstack_libs@ \
@mysql_plugin_libs@ \
--- 1.278/sql/handler.cc 2006-11-07 16:24:43 +03:00
+++ 1.279/sql/handler.cc 2006-11-07 16:24:43 +03:00
@@ -2959,15 +2959,15 @@ static my_bool binlog_func_list(THD *thd
static my_bool binlog_func_foreach(THD *thd, binlog_func_st *bfn)
{
- handlerton *hton;
hton_list_st hton_list;
+ uint i, sz;
+
hton_list.sz= 0;
plugin_foreach(thd, binlog_func_list,
MYSQL_STORAGE_ENGINE_PLUGIN, &hton_list);
- uint i= 0, sz= hton_list.sz;
- while(i < sz)
- hton_list.hton[i++]->binlog_func(hton, thd, bfn->fn, bfn->arg);
+ for (i= 0, sz= hton_list.sz; i < sz ; i++)
+ hton_list.hton[i]->binlog_func(hton_list.hton[i], thd, bfn->fn, bfn->arg);
return FALSE;
}
--- 1.139/sql/item_timefunc.cc 2006-11-07 16:24:43 +03:00
+++ 1.140/sql/item_timefunc.cc 2006-11-07 16:24:43 +03:00
@@ -1368,6 +1368,11 @@ bool get_interval_value(Item *args,inter
interval->second= array[0];
interval->second_part= array[1];
break;
+ /* purecov: begin deadcode */
+ case INTERVAL_LAST:
+ DBUG_ASSERT(0);
+ break;
+ /* purecov: end */
}
return 0;
}
@@ -2011,17 +2016,14 @@ bool Item_func_convert_tz::get_date(TIME
return 1;
}
- /* Check if we in range where we treat datetime values as non-UTC */
- if (ltime->year < TIMESTAMP_MAX_YEAR && ltime->year > TIMESTAMP_MIN_YEAR ||
- ltime->year==TIMESTAMP_MAX_YEAR && ltime->month==1 && ltime->day==1 ||
- ltime->year==TIMESTAMP_MIN_YEAR && ltime->month==12 && ltime->day==31)
{
my_bool not_used;
my_time_tmp= from_tz->TIME_to_gmt_sec(ltime, ¬_used);
- if (my_time_tmp >= TIMESTAMP_MIN_VALUE && my_time_tmp <= TIMESTAMP_MAX_VALUE)
+ /* my_time_tmp is guranteed to be in the allowed range */
+ if (my_time_tmp)
to_tz->gmt_sec_to_TIME(ltime, my_time_tmp);
}
-
+
null_value= 0;
return 0;
}
@@ -2197,6 +2199,7 @@ void Item_extract::fix_length_and_dec()
case INTERVAL_HOUR_MICROSECOND: max_length=13; date_value=0; break;
case INTERVAL_MINUTE_MICROSECOND: max_length=11; date_value=0; break;
case INTERVAL_SECOND_MICROSECOND: max_length=9; date_value=0; break;
+ case INTERVAL_LAST: DBUG_ASSERT(0); break; /* purecov: deadcode */
}
}
@@ -2266,6 +2269,8 @@ longlong Item_extract::val_int()
ltime.second_part)*neg;
case INTERVAL_SECOND_MICROSECOND: return ((longlong)ltime.second*1000000L+
ltime.second_part)*neg;
+ case INTERVAL_LAST: DBUG_ASSERT(0); return(0); /* purecov: deadcode */
+ /* purecov: end */
}
return 0; // Impossible
}
@@ -2380,7 +2385,7 @@ String *Item_char_typecast::val_str(Stri
{ // Safe even if const arg
char char_type[40];
my_snprintf(char_type, sizeof(char_type), "%s(%lu)",
- cast_cs == &my_charset_bin ? "BINARY" : "CHAR", length);
+ cast_cs == &my_charset_bin ? "BINARY" : "CHAR", (ulong) length);
if (!res->alloced_length())
{ // Don't change const str
--- 1.165/sql/lex.h 2006-11-07 16:24:43 +03:00
+++ 1.166/sql/lex.h 2006-11-07 16:24:43 +03:00
@@ -30,16 +30,7 @@ SYM_GROUP sym_group_rtree= {"RTree keys"
#define SYM_OR_NULL(A) A
#endif
-#define SYM(A) SYM_OR_NULL(A),0,0,&sym_group_common
-#define F_SYM(A) SYM_OR_NULL(A)
-
-#define CREATE_FUNC(A) (void *)(SYM_OR_NULL(A)), &sym_group_common
-
-#ifdef HAVE_SPATIAL
-#define CREATE_FUNC_GEOM(A) (void *)(SYM_OR_NULL(A)), &sym_group_geom
-#else
-#define CREATE_FUNC_GEOM(A) 0, &sym_group_geom
-#endif
+#define SYM(A) SYM_OR_NULL(A),0,&sym_group_common
/*
Symbols are broken into separated arrays to allow field names with
@@ -590,235 +581,38 @@ static SYMBOL symbols[] = {
static SYMBOL sql_functions[] = {
- { "ABS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_abs)},
- { "ACOS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_acos)},
{ "ADDDATE", SYM(ADDDATE_SYM)},
- { "ADDTIME", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_addtime)},
- { "AES_ENCRYPT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_encrypt)},
- { "AES_DECRYPT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_aes_decrypt)},
- { "AREA", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_area)},
- { "ASIN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_asin)},
- { "ASBINARY", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkb)},
- { "ASTEXT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkt)},
- { "ASWKB", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkb)},
- { "ASWKT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_as_wkt)},
- { "ATAN", SYM(ATAN)},
- { "ATAN2", SYM(ATAN)},
- { "BENCHMARK", SYM(BENCHMARK_SYM)},
- { "BIN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bin)},
- { "BIT_COUNT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_count)},
- { "BIT_OR", SYM(BIT_OR)},
{ "BIT_AND", SYM(BIT_AND)},
+ { "BIT_OR", SYM(BIT_OR)},
{ "BIT_XOR", SYM(BIT_XOR)},
{ "CAST", SYM(CAST_SYM)},
- { "CEIL", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
- { "CEILING", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ceiling)},
- { "BIT_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_bit_length)},
- { "CENTROID", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_centroid)},
- { "CHAR_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
- { "CHARACTER_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_char_length)},
- { "COERCIBILITY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_coercibility)},
- { "COMPRESS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_compress)},
- { "CONCAT", SYM(CONCAT)},
- { "CONCAT_WS", SYM(CONCAT_WS)},
- { "CONNECTION_ID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_connection_id)},
- { "CONV", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_conv)},
- { "CONVERT_TZ", SYM(CONVERT_TZ_SYM)},
{ "COUNT", SYM(COUNT_SYM)},
- { "COS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cos)},
- { "COT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_cot)},
- { "CRC32", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_crc32)},
- { "CROSSES", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_crosses)},
{ "CURDATE", SYM(CURDATE)},
{ "CURTIME", SYM(CURTIME)},
{ "DATE_ADD", SYM(DATE_ADD_INTERVAL)},
- { "DATEDIFF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_datediff)},
- { "DATE_FORMAT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_date_format)},
{ "DATE_SUB", SYM(DATE_SUB_INTERVAL)},
- { "DAYNAME", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayname)},
- { "DAYOFMONTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofmonth)},
- { "DAYOFWEEK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofweek)},
- { "DAYOFYEAR", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_dayofyear)},
- { "DECODE", SYM(DECODE_SYM)},
- { "DEGREES", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_degrees)},
- { "DES_ENCRYPT", SYM(DES_ENCRYPT_SYM)},
- { "DES_DECRYPT", SYM(DES_DECRYPT_SYM)},
- { "DIMENSION", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_dimension)},
- { "DISJOINT", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_disjoint)},
- { "ELT", SYM(ELT_FUNC)},
- { "ENCODE", SYM(ENCODE_SYM)},
- { "ENCRYPT", SYM(ENCRYPT)},
- { "ENDPOINT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_endpoint)},
- { "ENVELOPE", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_envelope)},
- { "EQUALS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)},
- { "EXTERIORRING", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_exteriorring)},
{ "EXTRACT", SYM(EXTRACT_SYM)},
- { "EXTRACTVALUE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_xml_extractvalue)},
- { "EXP", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_exp)},
- { "EXPORT_SET", SYM(EXPORT_SET)},
- { "FIELD", SYM(FIELD_FUNC)}, /* For compability */
- { "FIND_IN_SET", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_find_in_set)},
- { "FLOOR", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_floor)},
- { "FORMAT", SYM(FORMAT_SYM)},
- { "FOUND_ROWS", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_found_rows)},
- { "FROM_DAYS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_from_days)},
- { "FROM_UNIXTIME", SYM(FROM_UNIXTIME)},
- { "GET_LOCK", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_get_lock)},
- { "GEOMETRYN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_geometryn)},
- { "GEOMETRYTYPE", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_geometry_type)},
- { "GEOMCOLLFROMTEXT", SYM(GEOMCOLLFROMTEXT)},
- { "GEOMCOLLFROMWKB", SYM(GEOMFROMWKB)},
- { "GEOMETRYCOLLECTIONFROMTEXT",SYM(GEOMCOLLFROMTEXT)},
- { "GEOMETRYCOLLECTIONFROMWKB",SYM(GEOMFROMWKB)},
- { "GEOMETRYFROMTEXT", SYM(GEOMFROMTEXT)},
- { "GEOMETRYFROMWKB", SYM(GEOMFROMWKB)},
- { "GEOMFROMTEXT", SYM(GEOMFROMTEXT)},
- { "GEOMFROMWKB", SYM(GEOMFROMWKB)},
- { "GLENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_glength)},
- { "GREATEST", SYM(GREATEST_SYM)},
{ "GROUP_CONCAT", SYM(GROUP_CONCAT_SYM)},
{ "GROUP_UNIQUE_USERS", SYM(GROUP_UNIQUE_USERS)},
- { "HEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_hex)},
- { "IFNULL", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_ifnull)},
- { "INET_ATON", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_aton)},
- { "INET_NTOA", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_inet_ntoa)},
- { "INSTR", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_instr)},
- { "INTERIORRINGN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_interiorringn)},
- { "INTERSECTS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_intersects)},
- { "ISCLOSED", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_isclosed)},
- { "ISEMPTY", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_isempty)},
- { "ISNULL", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_isnull)},
- { "IS_FREE_LOCK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_free_lock)},
- { "IS_USED_LOCK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_is_used_lock)},
- { "LAST_INSERT_ID", SYM(LAST_INSERT_ID)},
- { "ISSIMPLE", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_issimple)},
- { "LAST_DAY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_last_day)},
- { "LCASE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
- { "LEAST", SYM(LEAST_SYM)},
- { "LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
- { "LN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ln)},
- { "LINEFROMTEXT", SYM(LINEFROMTEXT)},
- { "LINEFROMWKB", SYM(GEOMFROMWKB)},
- { "LINESTRINGFROMTEXT",SYM(LINEFROMTEXT)},
- { "LINESTRINGFROMWKB",SYM(GEOMFROMWKB)},
- { "LOAD_FILE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_load_file)},
- { "LOCATE", SYM(LOCATE)},
- { "LOG", SYM(LOG_SYM)},
- { "LOG2", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log2)},
- { "LOG10", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_log10)},
- { "LOWER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_lcase)},
- { "LPAD", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_lpad)},
- { "LTRIM", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ltrim)},
- { "MAKE_SET", SYM(MAKE_SET_SYM)},
- { "MAKEDATE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_makedate)},
- { "MAKETIME", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_maketime)},
- { "MASTER_POS_WAIT", SYM(MASTER_POS_WAIT)},
{ "MAX", SYM(MAX_SYM)},
- { "MBRCONTAINS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_contains)},
- { "MBRDISJOINT", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_disjoint)},
- { "MBREQUAL", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_equals)},
- { "MBRINTERSECTS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_intersects)},
- { "MBROVERLAPS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_overlaps)},
- { "MBRTOUCHES", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_touches)},
- { "MBRWITHIN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_within)},
- { "MD5", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_md5)},
{ "MID", SYM(SUBSTRING)}, /* unireg function */
{ "MIN", SYM(MIN_SYM)},
- { "MLINEFROMTEXT", SYM(MLINEFROMTEXT)},
- { "MLINEFROMWKB", SYM(GEOMFROMWKB)},
- { "MPOINTFROMTEXT", SYM(MPOINTFROMTEXT)},
- { "MPOINTFROMWKB", SYM(GEOMFROMWKB)},
- { "MPOLYFROMTEXT", SYM(MPOLYFROMTEXT)},
- { "MPOLYFROMWKB", SYM(GEOMFROMWKB)},
- { "MONTHNAME", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_monthname)},
- { "MULTILINESTRINGFROMTEXT",SYM(MLINEFROMTEXT)},
- { "MULTILINESTRINGFROMWKB",SYM(GEOMFROMWKB)},
- { "MULTIPOINTFROMTEXT",SYM(MPOINTFROMTEXT)},
- { "MULTIPOINTFROMWKB",SYM(GEOMFROMWKB)},
- { "MULTIPOLYGONFROMTEXT",SYM(MPOLYFROMTEXT)},
- { "MULTIPOLYGONFROMWKB",SYM(GEOMFROMWKB)},
- { "NAME_CONST", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_name_const)},
{ "NOW", SYM(NOW_SYM)},
- { "NULLIF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_nullif)},
- { "NUMGEOMETRIES", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numgeometries)},
- { "NUMINTERIORRINGS", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numinteriorring)},
- { "NUMPOINTS", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_numpoints)},
- { "OCTET_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_length)},
- { "OCT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_oct)},
- { "ORD", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ord)},
- { "OVERLAPS", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_overlaps)},
- { "PERIOD_ADD", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_add)},
- { "PERIOD_DIFF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_period_diff)},
- { "PI", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_pi)},
- { "POINTFROMTEXT", SYM(POINTFROMTEXT)},
- { "POINTFROMWKB", SYM(GEOMFROMWKB)},
- { "POINTN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_pointn)},
- { "POLYFROMTEXT", SYM(POLYFROMTEXT)},
- { "POLYFROMWKB", SYM(GEOMFROMWKB)},
- { "POLYGONFROMTEXT", SYM(POLYFROMTEXT)},
- { "POLYGONFROMWKB", SYM(GEOMFROMWKB)},
{ "POSITION", SYM(POSITION_SYM)},
- { "POW", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
- { "POWER", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_pow)},
- { "QUOTE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_quote)},
- { "RADIANS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_radians)},
- { "RAND", SYM(RAND)},
- { "RELEASE_LOCK", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_release_lock)},
- { "REVERSE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_reverse)},
- { "ROUND", SYM(ROUND)},
- { "ROW_COUNT", SYM(ROW_COUNT_SYM)},
- { "RPAD", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_rpad)},
- { "RTRIM", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_rtrim)},
- { "SEC_TO_TIME", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sec_to_time)},
- { "SESSION_USER", SYM(USER)},
- { "SUBDATE", SYM(SUBDATE_SYM)},
- { "SIGN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sign)},
- { "SIN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sin)},
- { "SHA", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
- { "SHA1", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sha)},
- { "SLEEP", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sleep)},
- { "SOUNDEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_soundex)},
- { "SPACE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_space)},
- { "SQRT", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_sqrt)},
- { "SRID", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_srid)},
- { "STARTPOINT", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_startpoint)},
+ { "SESSION_USER", SYM(USER)},
{ "STD", SYM(STD_SYM)},
{ "STDDEV", SYM(STD_SYM)},
{ "STDDEV_POP", SYM(STD_SYM)},
{ "STDDEV_SAMP", SYM(STDDEV_SAMP_SYM)},
- { "STR_TO_DATE", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_str_to_date)},
- { "STRCMP", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_strcmp)},
+ { "SUBDATE", SYM(SUBDATE_SYM)},
{ "SUBSTR", SYM(SUBSTRING)},
{ "SUBSTRING", SYM(SUBSTRING)},
- { "SUBSTRING_INDEX", SYM(SUBSTRING_INDEX)},
- { "SUBTIME", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_subtime)},
{ "SUM", SYM(SUM_SYM)},
{ "SYSDATE", SYM(SYSDATE)},
- { "SYSTEM_USER", SYM(USER)},
- { "TAN", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_tan)},
- { "TIME_FORMAT", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_time_format)},
- { "TIME_TO_SEC", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_time_to_sec)},
- { "TIMEDIFF", F_SYM(FUNC_ARG2),0,CREATE_FUNC(create_func_timediff)},
- { "TO_DAYS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_to_days)},
- { "TOUCHES", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_touches)},
+ { "SYSTEM_USER", SYM(USER)},
{ "TRIM", SYM(TRIM)},
- { "UCASE", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
- { "UNCOMPRESS", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompress)},
- { "UNCOMPRESSED_LENGTH", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_uncompressed_length)},
- { "UNHEX", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_unhex)},
{ "UNIQUE_USERS", SYM(UNIQUE_USERS)},
- { "UNIX_TIMESTAMP", SYM(UNIX_TIMESTAMP)},
- { "UPDATEXML", F_SYM(FUNC_ARG3),0,CREATE_FUNC(create_func_xml_update)},
- { "UPPER", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_ucase)},
- { "UUID", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_uuid)},
{ "VARIANCE", SYM(VARIANCE_SYM)},
{ "VAR_POP", SYM(VARIANCE_SYM)},
{ "VAR_SAMP", SYM(VAR_SAMP_SYM)},
- { "VERSION", F_SYM(FUNC_ARG0),0,CREATE_FUNC(create_func_version)},
- { "WEEKDAY", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekday)},
- { "WEEKOFYEAR", F_SYM(FUNC_ARG1),0,CREATE_FUNC(create_func_weekofyear)},
- { "WITHIN", F_SYM(FUNC_ARG2),0,CREATE_FUNC_GEOM(create_func_within)},
- { "X", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_x)},
- { "Y", F_SYM(FUNC_ARG1),0,CREATE_FUNC_GEOM(create_func_y)},
- { "YEARWEEK", SYM(YEARWEEK)}
};
--- 1.240/sql/log.cc 2006-11-07 16:24:43 +03:00
+++ 1.241/sql/log.cc 2006-11-07 16:24:43 +03:00
@@ -2086,7 +2086,7 @@ bool MYSQL_QUERY_LOG::write(time_t event
goto err;
/* command_type, thread_id */
- length= my_snprintf(buff, 32, "%5ld ", thread_id);
+ length= my_snprintf(buff, 32, "%5ld ", (long) thread_id);
if (my_b_write(&log_file, (byte*) buff, length))
goto err;
--- 1.452/sql/mysql_priv.h 2006-11-07 16:24:43 +03:00
+++ 1.453/sql/mysql_priv.h 2006-11-07 16:24:43 +03:00
@@ -223,12 +223,6 @@ MY_LOCALE *my_locale_by_name(const char
/* Characters shown for the command in 'information_schema.processlist' */
#define PROCESS_LIST_INFO_WIDTH 65535
-/* Time handling defaults */
-#define TIMESTAMP_MAX_YEAR 2038
-#define YY_PART_YEAR 70
-#define TIMESTAMP_MIN_YEAR (1900 + YY_PART_YEAR - 1)
-#define TIMESTAMP_MAX_VALUE 2145916799
-#define TIMESTAMP_MIN_VALUE 1
#define PRECISION_FOR_DOUBLE 53
#define PRECISION_FOR_FLOAT 24
@@ -2051,6 +2045,10 @@ inline void kill_delayed_threads(void) {
#define IS_FILES_EXTRA 37
void init_fill_schema_files_row(TABLE* table);
bool schema_table_store_record(THD *thd, TABLE *table);
+
+/* sql/item_create.cc */
+int item_create_init();
+void item_create_cleanup();
#endif /* MYSQL_SERVER */
#endif /* MYSQL_CLIENT */
--- 1.586/sql/mysqld.cc 2006-11-07 16:24:43 +03:00
+++ 1.587/sql/mysqld.cc 2006-11-07 16:24:43 +03:00
@@ -6595,6 +6595,10 @@ static int show_ssl_get_cipher_list(THD
#endif /* HAVE_OPENSSL */
+/*
+ Variables shown by SHOW STATUS in alphabetical order
+*/
+
SHOW_VAR status_vars[]= {
{"Aborted_clients", (char*) &aborted_threads, SHOW_LONG},
{"Aborted_connects", (char*) &aborted_connects, SHOW_LONG},
@@ -8102,16 +8106,20 @@ void refresh_status(THD *thd)
{
pthread_mutex_lock(&LOCK_status);
- /* We must update the global status before cleaning up the thread */
+ /* Add thread's status variabes to global status */
add_to_status(&global_status_var, &thd->status_var);
+
+ /* Reset thread's status variables */
bzero((char*) &thd->status_var, sizeof(thd->status_var));
+ /* Reset some global variables */
for (SHOW_VAR *ptr= status_vars; ptr->name; ptr++)
{
/* Note that SHOW_LONG_NOFLUSH variables are not reset */
if (ptr->type == SHOW_LONG)
*(ulong*) ptr->value= 0;
}
+
/* Reset the counters of all key caches (default and named). */
process_key_caches(reset_key_cache_counters);
pthread_mutex_unlock(&LOCK_status);
--- 1.325/sql/sql_class.h 2006-11-07 16:24:43 +03:00
+++ 1.326/sql/sql_class.h 2006-11-07 16:24:43 +03:00
@@ -1454,10 +1454,12 @@ public:
#ifndef EMBEDDED_LIBRARY
inline void clear_error()
{
+ DBUG_ENTER("clear_error");
net.last_error[0]= 0;
net.last_errno= 0;
net.report_error= 0;
query_error= 0;
+ DBUG_VOID_RETURN;
}
inline bool vio_ok() const { return net.vio != 0; }
#else
@@ -1575,8 +1577,11 @@ public:
or trigger is decided when it starts executing, depending for example on
the caller (for a stored function: if caller is SELECT or
INSERT/UPDATE/DELETE...).
+
+ Don't reset binlog format for NDB binlog injector thread.
*/
- if ((temporary_tables == NULL) && (in_sub_stmt == 0))
+ if ((temporary_tables == NULL) && (in_sub_stmt == 0) &&
+ (system_thread != SYSTEM_THREAD_NDBCLUSTER_BINLOG))
{
current_stmt_binlog_row_based=
test(variables.binlog_format == BINLOG_FORMAT_ROW);
--- 1.233/sql/sql_insert.cc 2006-11-07 16:24:43 +03:00
+++ 1.234/sql/sql_insert.cc 2006-11-07 16:24:43 +03:00
@@ -261,6 +261,8 @@ static int check_update_fields(THD *thd,
TABLE *table= insert_table_list->table;
my_bool timestamp_mark;
+ LINT_INIT(timestamp_mark);
+
if (table->timestamp_field)
{
/*
@@ -1699,7 +1701,7 @@ static int
write_delayed(THD *thd,TABLE *table, enum_duplicates duplic,
LEX_STRING query, bool ignore, bool log_on)
{
- delayed_row *row;
+ delayed_row *row= 0;
delayed_insert *di=thd->di;
const Discrete_interval *forced_auto_inc;
DBUG_ENTER("write_delayed");
@@ -2306,14 +2308,18 @@ bool delayed_insert::handle_inserts(void
DBUG_RETURN(0);
err:
- DBUG_EXECUTE("error", max_rows= 0;);
+#ifndef DBUG_OFF
+ max_rows= 0; // For DBUG output
+#endif
/* Remove all not used rows */
while ((row=rows.get()))
{
delete row;
thread_safe_increment(delayed_insert_errors,&LOCK_delayed_status);
stacked_inserts--;
- DBUG_EXECUTE("error", max_rows++;);
+#ifndef DBUG_OFF
+ max_rows++;
+#endif
}
DBUG_PRINT("error", ("dropped %lu rows after an error", max_rows));
thread_safe_increment(delayed_insert_errors, &LOCK_delayed_status);
--- 1.250/sql/sql_lex.h 2006-11-07 16:24:43 +03:00
+++ 1.251/sql/sql_lex.h 2006-11-07 16:24:43 +03:00
@@ -1203,6 +1203,8 @@ typedef struct st_lex : public Query_tab
void reset_n_backup_query_tables_list(Query_tables_list *backup);
void restore_backup_query_tables_list(Query_tables_list *backup);
+
+ bool table_or_sp_used();
} LEX;
struct st_lex_local: public st_lex
--- 1.592/sql/sql_parse.cc 2006-11-07 16:24:43 +03:00
+++ 1.593/sql/sql_parse.cc 2006-11-07 16:24:43 +03:00
@@ -3911,6 +3911,12 @@ end_with_restore_list:
case SQLCOM_ALTER_EVENT:
{
DBUG_ASSERT(lex->event_parse_data);
+ if (lex->table_or_sp_used())
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
+ "function calls as part of this statement");
+ break;
+ }
switch (lex->sql_command) {
case SQLCOM_CREATE_EVENT:
res= Events::get_instance()->
@@ -4182,6 +4188,13 @@ end_with_restore_list:
{
Item *it= (Item *)lex->value_list.head();
+ if (lex->table_or_sp_used())
+ {
+ my_error(ER_NOT_SUPPORTED_YET, MYF(0), "Usage of subqueries or stored "
+ "function calls as part of this statement");
+ break;
+ }
+
if ((!it->fixed && it->fix_fields(lex->thd, &it)) || it->check_cols(1))
{
my_message(ER_SET_CONSTANTS_ONLY, ER(ER_SET_CONSTANTS_ONLY),
@@ -4624,7 +4637,10 @@ end_with_restore_list:
send_ok(thd, (ulong) (thd->row_count_func < 0 ? 0 :
thd->row_count_func));
else
+ {
+ DBUG_ASSERT(thd->net.report_error == 1 || thd->killed);
goto error; // Substatement should already have sent error
+ }
}
break;
}
--- 1.463/sql/sql_select.cc 2006-11-07 16:24:43 +03:00
+++ 1.464/sql/sql_select.cc 2006-11-07 16:24:43 +03:00
@@ -3605,7 +3605,7 @@ best_access_path(JOIN *join,
double best= DBL_MAX;
double best_time= DBL_MAX;
double records= DBL_MAX;
- table_map best_ref_depends_map;
+ table_map best_ref_depends_map= 0;
double tmp;
ha_rows rec;
@@ -10106,7 +10106,8 @@ do_select(JOIN *join,List<Item> *fields,
enum_nested_loop_state error= NESTED_LOOP_OK;
JOIN_TAB *join_tab;
DBUG_ENTER("do_select");
-
+ LINT_INIT(join_tab);
+
join->procedure=procedure;
join->tmp_table= table; /* Save for easy recursion */
join->fields= fields;
@@ -10136,9 +10137,9 @@ do_select(JOIN *join,List<Item> *fields,
*/
if (!join->conds || join->conds->val_int())
{
- error= (*end_select)(join,join_tab,0);
+ error= (*end_select)(join, 0, 0);
if (error == NESTED_LOOP_OK || error == NESTED_LOOP_QUERY_LIMIT)
- error= (*end_select)(join,join_tab,1);
+ error= (*end_select)(join, 0, 1);
}
else if (join->send_row_on_empty_set())
{
@@ -10694,7 +10695,7 @@ int report_error(TABLE *table, int error
*/
if (error != HA_ERR_LOCK_DEADLOCK && error != HA_ERR_LOCK_WAIT_TIMEOUT)
sql_print_error("Got error %d when reading table '%s'",
- error, table->s->path);
+ error, table->s->path.str);
table->file->print_error(error,MYF(0));
return 1;
}
--- 1.513/sql/sql_yacc.yy 2006-11-07 16:24:43 +03:00
+++ 1.514/sql/sql_yacc.yy 2006-11-07 16:24:43 +03:00
@@ -3218,6 +3218,7 @@ opt_partitioning:
partitioning:
PARTITION_SYM
{
+#ifdef WITH_PARTITION_STORAGE_ENGINE
LEX *lex= Lex;
lex->part_info= new partition_info();
if (!lex->part_info)
@@ -3229,6 +3230,12 @@ partitioning:
{
lex->alter_info.flags|= ALTER_PARTITION;
}
+#else
+ my_error(ER_FEATURE_DISABLED, MYF(0),
+ "partitioning", "--with-partition");
+ YYABORT;
+#endif
+
}
partition
;
--- 1.251/sql/table.cc 2006-11-07 16:24:43 +03:00
+++ 1.252/sql/table.cc 2006-11-07 16:24:43 +03:00
@@ -479,7 +479,7 @@ static int open_binary_frm(THD *thd, TAB
sql_print_warning("'%s' had no or invalid character set, "
"and default character set is multi-byte, "
"so character column sizes may have changed",
- share->path);
+ share->path.str);
}
share->table_charset= default_charset_info;
}
--- 1.70/sql/time.cc 2006-11-07 16:24:43 +03:00
+++ 1.71/sql/time.cc 2006-11-07 16:24:43 +03:00
@@ -264,14 +264,11 @@ my_time_t TIME_to_timestamp(THD *thd, co
*in_dst_time_gap= 0;
- if (t->year < TIMESTAMP_MAX_YEAR && t->year > TIMESTAMP_MIN_YEAR ||
- t->year == TIMESTAMP_MAX_YEAR && t->month == 1 && t->day == 1 ||
- t->year == TIMESTAMP_MIN_YEAR && t->month == 12 && t->day == 31)
+ timestamp= thd->variables.time_zone->TIME_to_gmt_sec(t, in_dst_time_gap);
+ if (timestamp)
{
thd->time_zone_used= 1;
- timestamp= thd->variables.time_zone->TIME_to_gmt_sec(t, in_dst_time_gap);
- if (timestamp >= TIMESTAMP_MIN_VALUE && timestamp <= TIMESTAMP_MAX_VALUE)
- return timestamp;
+ return timestamp;
}
/* If we are here we have range error. */
--- 1.191/mysql-test/r/view.result 2006-11-07 16:24:43 +03:00
+++ 1.192/mysql-test/r/view.result 2006-11-07 16:24:43 +03:00
@@ -1980,7 +1980,7 @@ v1 CREATE ALGORITHM=UNDEFINED DEFINER=`r
drop view v1;
drop table t1;
set sql_mode='strict_all_tables';
-CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL) ENGINE = INNODB;
+CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL);
CREATE VIEW v1 (vcol1) AS SELECT col1 FROM t1;
CREATE VIEW v2 (vcol1) AS SELECT col1 FROM t1 WHERE col2 > 2;
INSERT INTO t1 (col1) VALUES(12);
@@ -2032,7 +2032,7 @@ f3 f1
1 3
drop view v1;
drop table t1;
-CREATE TABLE t1 (f1 char) ENGINE = innodb;
+CREATE TABLE t1 (f1 char);
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
INSERT INTO t1 VALUES('B');
--- 1.173/mysql-test/t/view.test 2006-11-07 16:24:43 +03:00
+++ 1.174/mysql-test/t/view.test 2006-11-07 16:24:43 +03:00
@@ -1793,9 +1793,7 @@ drop table t1;
# underlying tables (BUG#6443)
#
set sql_mode='strict_all_tables';
---disable_warnings
-CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL) ENGINE = INNODB;
---enable_warnings
+CREATE TABLE t1 (col1 INT NOT NULL, col2 INT NOT NULL);
CREATE VIEW v1 (vcol1) AS SELECT col1 FROM t1;
CREATE VIEW v2 (vcol1) AS SELECT col1 FROM t1 WHERE col2 > 2;
-- error 1364
@@ -1851,9 +1849,7 @@ drop table t1;
#
# Test for bug #11771: wrong query_id in SELECT * FROM <view>
#
---disable_warnings
-CREATE TABLE t1 (f1 char) ENGINE = innodb;
---enable_warnings
+CREATE TABLE t1 (f1 char);
INSERT INTO t1 VALUES ('A');
CREATE VIEW v1 AS SELECT * FROM t1;
--- 1.116/sql/sql_view.cc 2006-11-07 16:24:43 +03:00
+++ 1.117/sql/sql_view.cc 2006-11-07 16:24:43 +03:00
@@ -1101,6 +1101,8 @@ bool mysql_make_view(THD *thd, File_pars
bool view_is_mergeable= (table->algorithm != VIEW_ALGORITHM_TMPTABLE &&
lex->can_be_merged());
TABLE_LIST *view_main_select_tables;
+ LINT_INIT(view_main_select_tables);
+
if (view_is_mergeable)
{
/*
--- 1.219/mysql-test/mysql-test-run.pl 2006-11-07 16:24:43 +03:00
+++ 1.220/mysql-test/mysql-test-run.pl 2006-11-07 16:24:43 +03:00
@@ -1826,7 +1826,7 @@ sub environment_setup () {
# ----------------------------------------------------
# We are nice and report a bit about our settings
# ----------------------------------------------------
- if (!$opt_extern)
+ if (!$opt_extern && $opt_verbose)
{
print "Using MTR_BUILD_THREAD = $ENV{MTR_BUILD_THREAD}\n";
print "Using MASTER_MYPORT = $ENV{MASTER_MYPORT}\n";
@@ -2544,6 +2544,11 @@ sub initialize_servers () {
}
check_running_as_root();
}
+ else
+ {
+ # We have to create the 'var' and related directories
+ cleanup_stale_files();
+ }
}
sub mysql_install_db () {
@@ -2910,15 +2915,18 @@ sub do_before_run_mysqltest($)
unlink("$result_dir/$tname.log");
unlink("$result_dir/$tname.warnings");
- mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
+ if (!$opt_extern)
+ {
+ mtr_tonewfile($path_current_test_log,"$tname\n"); # Always tell where we are
- # output current test to ndbcluster log file to enable diagnostics
- mtr_tofile($path_ndb_testrun_log,"CURRENT TEST $tname\n");
+ # output current test to ndbcluster log file to enable diagnostics
+ mtr_tofile($path_ndb_testrun_log,"CURRENT TEST $tname\n");
- mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
- if ( $master->[1]->{'pid'} )
- {
- mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+ mtr_tofile($master->[0]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+ if ( $master->[1]->{'pid'} )
+ {
+ mtr_tofile($master->[1]->{'path_myerr'},"CURRENT_TEST: $tname\n");
+ }
}
if ( $mysql_version_id < 50000 )
@@ -3935,7 +3943,6 @@ sub run_testcase_stop_servers($$$) {
if ( $do_restart || $do_slave_restart )
{
-
delete $slave->[0]->{'running_slave_options'}; # Forget history
# Start shutdown of all started slaves
@@ -4393,7 +4400,6 @@ sub run_mysqltest ($) {
}
return $res;
-
}
--- 1.17/include/my_time.h 2006-11-07 16:24:43 +03:00
+++ 1.18/include/my_time.h 2006-11-07 16:24:43 +03:00
@@ -63,6 +63,16 @@ typedef long my_time_t;
#define TIME_NO_ZERO_DATE (TIME_NO_ZERO_IN_DATE*2)
#define TIME_INVALID_DATES (TIME_NO_ZERO_DATE*2)
+#define MYSQL_TIME_WARN_TRUNCATED 1
+#define MYSQL_TIME_WARN_OUT_OF_RANGE 2
+
+/* Limits for the TIME data type */
+#define TIME_MAX_HOUR 838
+#define TIME_MAX_MINUTE 59
+#define TIME_MAX_SECOND 59
+#define TIME_MAX_VALUE (TIME_MAX_HOUR*10000 + TIME_MAX_MINUTE*100 + \
+ TIME_MAX_SECOND)
+
enum enum_mysql_timestamp_type
str_to_datetime(const char *str, uint length, MYSQL_TIME *l_time,
uint flags, int *was_cut);
@@ -75,7 +85,9 @@ ulonglong TIME_to_ulonglong(const MYSQL_
my_bool str_to_time(const char *str,uint length, MYSQL_TIME *l_time,
- int *was_cut);
+ int *warning);
+
+int check_time_range(struct st_mysql_time *time, int *warning);
long calc_daynr(uint year,uint month,uint day);
uint calc_days_in_year(uint year);
@@ -127,17 +139,25 @@ int my_date_to_str(const MYSQL_TIME *l_t
int my_datetime_to_str(const MYSQL_TIME *l_time, char *to);
int my_TIME_to_str(const MYSQL_TIME *l_time, char *to);
-/*
- The following must be sorted so that simple intervals comes first.
- (get_interval_value() depends on this)
- When updating this enum please update
- LEX_STRING interval_type_to_name[] in sql/time.cc
+/*
+ Available interval types used in any statement.
+
+ 'interval_type' must be sorted so that simple intervals comes first,
+ ie year, quarter, month, week, day, hour, etc. The order based on
+ interval size is also important and the intervals should be kept in a
+ large to smaller order. (get_interval_value() depends on this)
+
+ Note: If you change the order of elements in this enum you should fix
+ order of elements in 'interval_type_to_name' and 'interval_names'
+ arrays
+
+ See also interval_type_to_name, get_interval_value, interval_names
*/
enum interval_type
{
- INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_DAY, INTERVAL_HOUR,
- INTERVAL_MINUTE, INTERVAL_WEEK, INTERVAL_SECOND, INTERVAL_MICROSECOND ,
+ INTERVAL_YEAR, INTERVAL_QUARTER, INTERVAL_MONTH, INTERVAL_WEEK, INTERVAL_DAY,
+ INTERVAL_HOUR, INTERVAL_MINUTE, INTERVAL_SECOND, INTERVAL_MICROSECOND,
INTERVAL_YEAR_MONTH, INTERVAL_DAY_HOUR, INTERVAL_DAY_MINUTE,
INTERVAL_DAY_SECOND, INTERVAL_HOUR_MINUTE, INTERVAL_HOUR_SECOND,
INTERVAL_MINUTE_SECOND, INTERVAL_DAY_MICROSECOND, INTERVAL_HOUR_MICROSECOND,
--- 1.24/sql-common/my_time.c 2006-11-07 16:24:43 +03:00
+++ 1.25/sql-common/my_time.c 2006-11-07 16:24:43 +03:00
@@ -778,16 +778,28 @@ long calc_daynr(uint year,uint month,uin
RETURN VALUE
Time in UTC seconds since Unix Epoch representation.
*/
-my_time_t
-my_system_gmt_sec(const MYSQL_TIME *t, long *my_timezone,
- my_bool *in_dst_time_gap)
+my_time_t
+my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone,
+ bool *in_dst_time_gap)
{
uint loop;
- time_t tmp;
+ time_t tmp= 0;
+ int shift= 0;
+ MYSQL_TIME tmp_time;
+ MYSQL_TIME *t= &tmp_time;
struct tm *l_time,tm_tmp;
long diff, current_timezone;
/*
+ Use temp variable to avoid trashing input data, which could happen in
+ case of shift required for boundary dates processing.
+ */
+ memcpy(&tmp_time, t_src, sizeof(MYSQL_TIME));
+
+ if (!validate_timestamp_range(t))
+ return 0;
+
+ /*
Calculate the gmt time based on current time and timezone
The -1 on the end is to ensure that if have a date that exists twice
(like 2002-10-27 02:00:0 MET), we will find the initial date.
@@ -800,13 +812,89 @@ my_system_gmt_sec(const MYSQL_TIME *t, l
Note: this code assumes that our time_t estimation is not too far away
from real value (we assume that localtime_r(tmp) will return something
within 24 hrs from t) which is probably true for all current time zones.
+
+ Note2: For the dates, which have time_t representation close to
+ MAX_INT32 (efficient time_t limit for supported platforms), we should
+ do a small trick to avoid overflow. That is, convert the date, which is
+ two days earlier, and then add these days to the final value.
+
+ The same trick is done for the values close to 0 in time_t
+ representation for platfroms with unsigned time_t (QNX).
+
+ To be more verbose, here is a sample (extracted from the code below):
+ (calc_daynr(2038, 1, 19) - (long) days_at_timestart)*86400L + 4*3600L
+ would return -2147480896 because of the long type overflow. In result
+ we would get 1901 year in localtime_r(), which is an obvious error.
+
+ Alike problem raises with the dates close to Epoch. E.g.
+ (calc_daynr(1969, 12, 31) - (long) days_at_timestart)*86400L + 23*3600L
+ will give -3600.
+
+ On some platforms, (E.g. on QNX) time_t is unsigned and localtime(-3600)
+ wil give us a date around 2106 year. Which is no good.
+
+ Theoreticaly, there could be problems with the latter conversion:
+ there are at least two timezones, which had time switches near 1 Jan
+ of 1970 (because of political reasons). These are America/Hermosillo and
+ America/Mazatlan time zones. They changed their offset on
+ 1970-01-01 08:00:00 UTC from UTC-8 to UTC-7. For these zones
+ the code below will give incorrect results for dates close to
+ 1970-01-01, in the case OS takes into account these historical switches.
+ Luckily, it seems that we support only one platform with unsigned
+ time_t. It's QNX. And QNX does not support historical timezone data at all.
+ E.g. there are no /usr/share/zoneinfo/ files or any other mean to supply
+ historical information for localtime_r() etc. That is, the problem is not
+ relevant to QNX.
+
+ We are safe with shifts close to MAX_INT32, as there are no known
+ time switches on Jan 2038 yet :)
*/
- tmp=(time_t) (((calc_daynr((uint) t->year,(uint) t->month,(uint) t->day) -
- (long) days_at_timestart)*86400L + (long) t->hour*3600L +
- (long) (t->minute*60 + t->second)) + (time_t) my_time_zone -
- 3600);
- current_timezone= my_time_zone;
+ if ((t->year == TIMESTAMP_MAX_YEAR) && (t->month == 1) && (t->day > 4))
+ {
+ /*
+ Below we will pass (uint) (t->day - shift) to calc_daynr.
+ As we don't want to get an overflow here, we will shift
+ only safe dates. That's why we have (t->day > 4) above.
+ */
+ t->day-= 2;
+ shift= 2;
+ }
+#ifdef TIME_T_UNSIGNED
+ else
+ {
+ /*
+ We can get 0 in time_t representaion only on 1969, 31 of Dec or on
+ 1970, 1 of Jan. For both dates we use shift, which is added
+ to t->day in order to step out a bit from the border.
+ This is required for platforms, where time_t is unsigned.
+ As far as I know, among the platforms we support it's only QNX.
+ Note: the order of below if-statements is significant.
+ */
+
+ if ((t->year == TIMESTAMP_MIN_YEAR + 1) && (t->month == 1)
+ && (t->day <= 10))
+ {
+ t->day+= 2;
+ shift= -2;
+ }
+
+ if ((t->year == TIMESTAMP_MIN_YEAR) && (t->month == 12)
+ && (t->day == 31))
+ {
+ t->year++;
+ t->month= 1;
+ t->day= 2;
+ shift= -2;
+ }
+ }
+#endif
+
+ tmp= (time_t) (((calc_daynr((uint) t->year, (uint) t->month, (uint) t->day) -
+ (long) days_at_timestart)*86400L + (long) t->hour*3600L +
+ (long) (t->minute*60 + t->second)) + (time_t) my_time_zone -
+ 3600);
+ current_timezone= my_time_zone;
localtime_r(&tmp,&tm_tmp);
l_time=&tm_tmp;
for (loop=0;
@@ -858,7 +946,24 @@ my_system_gmt_sec(const MYSQL_TIME *t, l
*in_dst_time_gap= 1;
}
*my_timezone= current_timezone;
-
+
+
+ /* shift back, if we were dealing with boundary dates */
+ tmp+= shift*86400L;
+
+ /*
+ This is possible for dates, which slightly exceed boundaries.
+ Conversion will pass ok for them, but we don't allow them.
+ First check will pass for platforms with signed time_t.
+ instruction above (tmp+= shift*86400L) could exceed
+ MAX_INT32 (== TIMESTAMP_MAX_VALUE) and overflow will happen.
+ So, tmp < TIMESTAMP_MIN_VALUE will be triggered. On platfroms
+ with unsigned time_t tmp+= shift*86400L might result in a number,
+ larger then TIMESTAMP_MAX_VALUE, so another check will work.
+ */
+ if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE))
+ tmp= 0;
+end:
return (my_time_t) tmp;
} /* my_system_gmt_sec */
--- 1.84/mysql-test/r/func_time.result 2006-11-07 16:24:43 +03:00
+++ 1.85/mysql-test/r/func_time.result 2006-11-07 16:24:43 +03:00
@@ -550,12 +550,48 @@ unix_timestamp('1969-12-01 19:00:01')
select from_unixtime(-1);
from_unixtime(-1)
NULL
-select from_unixtime(2145916800);
-from_unixtime(2145916800)
+select from_unixtime(2147483647);
+from_unixtime(2147483647)
+2038-01-19 06:14:07
+select from_unixtime(2147483648);
+from_unixtime(2147483648)
NULL
select from_unixtime(0);
from_unixtime(0)
1970-01-01 03:00:00
+select unix_timestamp(from_unixtime(2147483647));
+unix_timestamp(from_unixtime(2147483647))
+2147483647
+select unix_timestamp(from_unixtime(2147483648));
+unix_timestamp(from_unixtime(2147483648))
+NULL
+select unix_timestamp('2039-01-20 01:00:00');
+unix_timestamp('2039-01-20 01:00:00')
+0
+select unix_timestamp('1968-01-20 01:00:00');
+unix_timestamp('1968-01-20 01:00:00')
+0
+select unix_timestamp('2038-02-10 01:00:00');
+unix_timestamp('2038-02-10 01:00:00')
+0
+select unix_timestamp('1969-11-20 01:00:00');
+unix_timestamp('1969-11-20 01:00:00')
+0
+select unix_timestamp('2038-01-20 01:00:00');
+unix_timestamp('2038-01-20 01:00:00')
+0
+select unix_timestamp('1969-12-30 01:00:00');
+unix_timestamp('1969-12-30 01:00:00')
+0
+select unix_timestamp('2038-01-17 12:00:00');
+unix_timestamp('2038-01-17 12:00:00')
+2147331600
+select unix_timestamp('1970-01-01 03:00:01');
+unix_timestamp('1970-01-01 03:00:01')
+1
+select unix_timestamp('2038-01-19 07:14:07');
+unix_timestamp('2038-01-19 07:14:07')
+0
CREATE TABLE t1 (datetime datetime, timestamp timestamp, date date, time time);
INSERT INTO t1 values ("2001-01-02 03:04:05", "2002-01-02 03:04:05", "2003-01-02", "06:07:08");
SELECT * from t1;
--- 1.15/mysql-test/r/rename.result 2006-11-07 16:24:43 +03:00
+++ 1.16/mysql-test/r/rename.result 2006-11-07 16:24:43 +03:00
@@ -54,6 +54,7 @@ Tables_in_test
t2
t4
drop table t2, t4;
+End of 4.1 tests
create table t1(f1 int);
create view v1 as select * from t1;
alter table v1 rename to v2;
@@ -64,3 +65,4 @@ rename table v2 to v1;
ERROR 42S01: Table 'v1' already exists
drop view v1;
drop table t1;
+End of 5.0 tests
--- 1.69/mysql-test/t/func_time.test 2006-11-07 16:24:43 +03:00
+++ 1.70/mysql-test/t/func_time.test 2006-11-07 16:24:43 +03:00
@@ -255,15 +255,55 @@ select unix_timestamp(@a);
select unix_timestamp('1969-12-01 19:00:01');
#
-# Test for bug #6439 "unix_timestamp() function returns wrong datetime
-# values for too big argument" and bug #7515 "from_unixtime(0) now
-# returns NULL instead of the epoch". unix_timestamp() should return error
-# for too big or negative argument. It should return Epoch value for zero
-# argument since it seems that many user's rely on this fact.
+# Tests for bug #6439 "unix_timestamp() function returns wrong datetime
+# values for too big argument", bug #7515 "from_unixtime(0) now
+# returns NULL instead of the epoch" and bug #9191
+# "TIMESTAMP/from_unixtime() no longer accepts 2^31-1."
+# unix_timestamp() should return error for too big or negative argument.
+# It should return Epoch value for zero argument since it seems that many
+# users rely on this fact, from_unixtime() should work with values
+# up to INT_MAX32 because of the same reason.
#
select from_unixtime(-1);
-select from_unixtime(2145916800);
+# check for from_unixtime(2^31-1) and from_unixtime(2^31)
+select from_unixtime(2147483647);
+select from_unixtime(2147483648);
select from_unixtime(0);
+
+#
+# Some more tests for bug #9191 "TIMESTAMP/from_unixtime() no
+# longer accepts 2^31-1". Here we test that from_unixtime and
+# unix_timestamp are consistent, when working with boundary dates.
+#
+select unix_timestamp(from_unixtime(2147483647));
+select unix_timestamp(from_unixtime(2147483648));
+
+# check for invalid dates
+
+# bad year
+select unix_timestamp('2039-01-20 01:00:00');
+select unix_timestamp('1968-01-20 01:00:00');
+# bad month
+select unix_timestamp('2038-02-10 01:00:00');
+select unix_timestamp('1969-11-20 01:00:00');
+# bad day
+select unix_timestamp('2038-01-20 01:00:00');
+select unix_timestamp('1969-12-30 01:00:00');
+
+#
+# Check negative shift (we subtract several days for boundary dates during
+# conversion).
+select unix_timestamp('2038-01-17 12:00:00');
+
+#
+# Check positive shift. (it happens only on
+# platfroms with unsigned time_t, such as QNX)
+#
+select unix_timestamp('1970-01-01 03:00:01');
+
+# check bad date, close to the boundary (we cut them off in the very end)
+select unix_timestamp('2038-01-19 07:14:07');
+
#
# Test types from + INTERVAL
--- 1.14/mysql-test/t/rename.test 2006-11-07 16:24:43 +03:00
+++ 1.15/mysql-test/t/rename.test 2006-11-07 16:24:43 +03:00
@@ -77,6 +77,10 @@ disconnect con2;
disconnect con1;
connection default;
+
+--echo End of 4.1 tests
+
+
#
# Bug#14959: ALTER TABLE isn't able to rename a view
#
@@ -90,4 +94,6 @@ rename table v2 to v1;
rename table v2 to v1;
drop view v1;
drop table t1;
-# End of 4.1 tests
+
+
+--echo End of 5.0 tests
--- 1.16/mysql-test/r/kill.result 2006-11-07 16:24:43 +03:00
+++ 1.17/mysql-test/r/kill.result 2006-11-07 16:24:43 +03:00
@@ -16,7 +16,7 @@ select 4;
4
drop table t1;
kill (select count(*) from mysql.user);
-ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'select count(*) from mysql.user)' at line 1
+ERROR 42000: This version of MySQL doesn't yet support 'Usage of subqueries or stored function calls as part of this statement'
create table t1 (id int primary key);
create table t2 (id int unsigned not null);
insert into t2 select id from t1;
--- 1.86/mysql-test/r/ps.result 2006-11-07 16:24:43 +03:00
+++ 1.87/mysql-test/r/ps.result 2006-11-07 16:24:43 +03:00
@@ -502,7 +502,8 @@ deallocate prepare stmt;
create table t1 (a varchar(20));
insert into t1 values ('foo');
prepare stmt FROM 'SELECT char_length (a) FROM t1';
-ERROR 42000: FUNCTION test.char_length does not exist
+prepare stmt2 FROM 'SELECT not_a_function (a) FROM t1';
+ERROR 42000: FUNCTION test.not_a_function does not exist
drop table t1;
prepare stmt from "SELECT SQL_CALC_FOUND_ROWS 'foo' UNION SELECT 'bar' LIMIT 0";
execute stmt;
@@ -1056,7 +1057,8 @@ End of 4.1 tests.
create table t1 (a varchar(20));
insert into t1 values ('foo');
prepare stmt FROM 'SELECT char_length (a) FROM t1';
-ERROR 42000: FUNCTION test.char_length does not exist
+prepare stmt2 FROM 'SELECT not_a_function (a) FROM t1';
+ERROR 42000: FUNCTION test.not_a_function does not exist
drop table t1;
create table t1 (a char(3) not null, b char(3) not null,
c char(3) not null, primary key (a, b, c));
--- 1.85/mysql-test/t/ps.test 2006-11-07 16:24:43 +03:00
+++ 1.86/mysql-test/t/ps.test 2006-11-07 16:24:43 +03:00
@@ -523,8 +523,9 @@ deallocate prepare stmt;
#
create table t1 (a varchar(20));
insert into t1 values ('foo');
---error 1305
prepare stmt FROM 'SELECT char_length (a) FROM t1';
+-- error ER_SP_DOES_NOT_EXIST
+prepare stmt2 FROM 'SELECT not_a_function (a) FROM t1';
drop table t1;
#
@@ -1126,8 +1127,9 @@ DROP TABLE t1;
#
create table t1 (a varchar(20));
insert into t1 values ('foo');
---error 1305
prepare stmt FROM 'SELECT char_length (a) FROM t1';
+-- error ER_SP_DOES_NOT_EXIST
+prepare stmt2 FROM 'SELECT not_a_function (a) FROM t1';
drop table t1;
#
--- 1.226/tests/mysql_client_test.c 2006-11-07 16:24:43 +03:00
+++ 1.227/tests/mysql_client_test.c 2006-11-07 16:24:43 +03:00
@@ -8698,7 +8698,7 @@ static void test_sqlmode()
if (!opt_silent)
fprintf(stdout, "\n query: %s", query);
stmt= mysql_simple_prepare(mysql, query);
- check_stmt_r(stmt);
+ check_stmt(stmt);
/* ANSI */
strmov(query, "SET SQL_MODE= \"ANSI\"");
| Thread |
|---|
| • bk commit into 5.1 tree (anozdrin:1.2341) | Alexander Nozdrin | 7 Nov |