summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2006-06-30 02:35:52 +0300
committerunknown <monty@mysql.com>2006-06-30 02:35:52 +0300
commit2226065b276ff42f2f34e3bf8cb7a294280c8531 (patch)
tree29ffb26ceb57114fe458abcaf7a0ef3a0b963af7
parent7bc46be138e7c2c95341ceaefb7571c88d4fb414 (diff)
parent77deeb7ee6b533f3cafac3524362cd783c79b2e8 (diff)
downloadmariadb-git-2226065b276ff42f2f34e3bf8cb7a294280c8531.tar.gz
Merge mysql.com:/home/my/mysql-4.1
into mysql.com:/home/my/mysql-5.0 include/my_global.h: Auto merged mysql-test/r/func_sapdb.result: Auto merged mysql-test/r/symlink.result: Auto merged mysql-test/t/func_sapdb.test: Auto merged mysys/my_handler.c: Auto merged sql/item_timefunc.cc: Auto merged sql/sql_parse.cc: Auto merged strings/strtod.c: Auto merged mysql-test/r/func_time.result: Manual merge mysql-test/t/func_time.test: Manual merge
-rw-r--r--heap/hp_test1.c3
-rw-r--r--heap/hp_test2.c1
-rw-r--r--include/my_global.h4
-rw-r--r--mysql-test/r/func_sapdb.result6
-rw-r--r--mysql-test/r/func_time.result6
-rw-r--r--mysql-test/r/symlink.result6
-rw-r--r--mysql-test/t/func_sapdb.test2
-rw-r--r--mysql-test/t/func_time.test4
-rw-r--r--mysys/my_handler.c1
-rw-r--r--sql/item_timefunc.cc11
-rw-r--r--sql/sql_parse.cc6
-rw-r--r--strings/strtod.c4
12 files changed, 44 insertions, 10 deletions
diff --git a/heap/hp_test1.c b/heap/hp_test1.c
index dd696528eb8..1efa97842c7 100644
--- a/heap/hp_test1.c
+++ b/heap/hp_test1.c
@@ -44,6 +44,7 @@ int main(int argc, char **argv)
get_options(argc,argv);
bzero(&hp_create_info, sizeof(hp_create_info));
+ hp_create_info.max_table_size= 1024L*1024L;
keyinfo[0].keysegs=1;
keyinfo[0].seg=keyseg;
@@ -58,7 +59,7 @@ int main(int argc, char **argv)
bzero((gptr) flags,sizeof(flags));
printf("- Creating heap-file\n");
- if (heap_create(filename,1,keyinfo,30,(ulong) flag*100000l,10l,
+ if (heap_create(filename,1,keyinfo,30,(ulong) flag*100000L,101L,
&hp_create_info) ||
!(file= heap_open(filename, 2)))
goto err;
diff --git a/heap/hp_test2.c b/heap/hp_test2.c
index 2de49bcb66b..ff07b402f4d 100644
--- a/heap/hp_test2.c
+++ b/heap/hp_test2.c
@@ -74,6 +74,7 @@ int main(int argc, char *argv[])
get_options(argc,argv);
bzero(&hp_create_info, sizeof(hp_create_info));
+ hp_create_info.max_table_size= 1024L*1024L;
write_count=update=opt_delete=0;
key_check=0;
diff --git a/include/my_global.h b/include/my_global.h
index c9f27e0031e..909755aef87 100644
--- a/include/my_global.h
+++ b/include/my_global.h
@@ -1071,8 +1071,8 @@ do { doubleget_union _tmp; \
#define doublestore(T,V) do { *((long *) T) = ((doubleget_union *)&V)->m[0]; \
*(((long *) T)+1) = ((doubleget_union *)&V)->m[1]; \
} while (0)
-#define float4get(V,M) do { *((long *) &(V)) = *((long*) (M)); } while(0)
-#define float8get(V,M) doubleget((V),(M))
+#define float4get(V,M) do { *((float *) &(V)) = *((float*) (M)); } while(0)
+#define float8get(V,M) doubleget((V),(M))
#define float4store(V,M) memcpy((byte*) V,(byte*) (&M),sizeof(float))
#define floatstore(T,V) memcpy((byte*)(T), (byte*)(&V),sizeof(float))
#define floatget(V,M) memcpy((byte*) &V,(byte*) (M),sizeof(float))
diff --git a/mysql-test/r/func_sapdb.result b/mysql-test/r/func_sapdb.result
index d984eee80fa..64eb6eefd1a 100644
--- a/mysql-test/r/func_sapdb.result
+++ b/mysql-test/r/func_sapdb.result
@@ -81,6 +81,12 @@ makedate(1997,1)
select makedate(1997,0);
makedate(1997,0)
NULL
+select makedate(9999,365);
+makedate(9999,365)
+9999-12-31
+select makedate(9999,366);
+makedate(9999,366)
+NULL
select addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002");
addtime("1997-12-31 23:59:59.999999", "1 1:1:1.000002")
1998-01-02 01:01:01.000001
diff --git a/mysql-test/r/func_time.result b/mysql-test/r/func_time.result
index a10e6675522..96591086f00 100644
--- a/mysql-test/r/func_time.result
+++ b/mysql-test/r/func_time.result
@@ -361,6 +361,12 @@ extract(SECOND FROM "1999-01-02 10:11:12")
select extract(MONTH FROM "2001-02-00");
extract(MONTH FROM "2001-02-00")
2
+SELECT DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
+DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE)
+9999-12-31 00:00:00
+SELECT DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
+DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE)
+9999-12-31 00:00:00
SELECT EXTRACT(QUARTER FROM '2004-01-15') AS quarter;
quarter
1
diff --git a/mysql-test/r/symlink.result b/mysql-test/r/symlink.result
index 3ce7cc0c835..272836c450a 100644
--- a/mysql-test/r/symlink.result
+++ b/mysql-test/r/symlink.result
@@ -74,18 +74,24 @@ t9 CREATE TABLE `t9` (
) ENGINE=MyISAM AUTO_INCREMENT=16725 DEFAULT CHARSET=latin1 DATA DIRECTORY='MYSQLTEST_VARDIR/tmp/' INDEX DIRECTORY='MYSQLTEST_VARDIR/run/'
drop database mysqltest;
create table t1 (a int not null) engine=myisam;
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
alter table t1 add b int;
+Warnings:
+Warning 0 DATA DIRECTORY option ignored
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` int(11) NOT NULL,
`b` int(11) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+Warnings:
+Warning 0 INDEX DIRECTORY option ignored
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
diff --git a/mysql-test/t/func_sapdb.test b/mysql-test/t/func_sapdb.test
index 6189712b5fe..97101fba615 100644
--- a/mysql-test/t/func_sapdb.test
+++ b/mysql-test/t/func_sapdb.test
@@ -43,6 +43,8 @@ select weekofyear("1997-11-30 23:59:59.000001");
select makedate(1997,1);
select makedate(1997,0);
+select makedate(9999,365);
+select makedate(9999,366);
#Time functions
diff --git a/mysql-test/t/func_time.test b/mysql-test/t/func_time.test
index 05c033f2b22..920ad31c1d4 100644
--- a/mysql-test/t/func_time.test
+++ b/mysql-test/t/func_time.test
@@ -143,6 +143,10 @@ select extract(SECOND FROM "1999-01-02 10:11:12");
select extract(MONTH FROM "2001-02-00");
#
+# MySQL Bugs: #12356: DATE_SUB or DATE_ADD incorrectly returns null
+#
+SELECT DATE_SUB(str_to_date('9999-12-31 00:01:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
+SELECT DATE_ADD(str_to_date('9999-12-30 23:59:00','%Y-%m-%d %H:%i:%s'), INTERVAL 1 MINUTE);
# test EXTRACT QUARTER (Bug #18100)
#
diff --git a/mysys/my_handler.c b/mysys/my_handler.c
index 56f2298a9f0..23d28956808 100644
--- a/mysys/my_handler.c
+++ b/mysys/my_handler.c
@@ -15,6 +15,7 @@
Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA */
+#include <my_global.h>
#include "my_handler.h"
int mi_compare_text(CHARSET_INFO *charset_info, uchar *a, uint a_length,
diff --git a/sql/item_timefunc.cc b/sql/item_timefunc.cc
index d8b309978d5..f741984e05f 100644
--- a/sql/item_timefunc.cc
+++ b/sql/item_timefunc.cc
@@ -27,6 +27,7 @@
/* TODO: Move month and days to language files */
+/* Day number for Dec 31st, 9999 */
#define MAX_DAY_NUMBER 3652424L
static const char *month_names[]=
@@ -408,7 +409,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
if (yearday > 0)
{
uint days= calc_daynr(l_time->year,1,1) + yearday - 1;
- if (days <= 0 || days >= MAX_DAY_NUMBER)
+ if (days <= 0 || days > MAX_DAY_NUMBER)
goto err;
get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day);
}
@@ -454,7 +455,7 @@ static bool extract_date_time(DATE_TIME_FORMAT *format,
(weekday - 1);
}
- if (days <= 0 || days >= MAX_DAY_NUMBER)
+ if (days <= 0 || days > MAX_DAY_NUMBER)
goto err;
get_date_from_daynr(days,&l_time->year,&l_time->month,&l_time->day);
}
@@ -2035,7 +2036,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
ltime->hour= (uint) (sec/3600);
daynr= calc_daynr(ltime->year,ltime->month,1) + days;
/* Day number from year 0 to 9999-12-31 */
- if ((ulonglong) daynr >= MAX_DAY_NUMBER)
+ if ((ulonglong) daynr > MAX_DAY_NUMBER)
goto invalid_date;
get_date_from_daynr((long) daynr, &ltime->year, &ltime->month,
&ltime->day);
@@ -2046,7 +2047,7 @@ bool Item_date_add_interval::get_date(TIME *ltime, uint fuzzy_date)
period= (calc_daynr(ltime->year,ltime->month,ltime->day) +
sign * (long) interval.day);
/* Daynumber from year 0 to 9999-12-31 */
- if ((ulong) period >= MAX_DAY_NUMBER)
+ if ((ulong) period > MAX_DAY_NUMBER)
goto invalid_date;
get_date_from_daynr((long) period,&ltime->year,&ltime->month,&ltime->day);
break;
@@ -2570,7 +2571,7 @@ String *Item_func_makedate::val_str(String *str)
days= calc_daynr(yearnr,1,1) + daynr - 1;
/* Day number from year 0 to 9999-12-31 */
- if (days >= 0 && days < MAX_DAY_NUMBER)
+ if (days >= 0 && days <= MAX_DAY_NUMBER)
{
null_value=0;
get_date_from_daynr(days,&l_time.year,&l_time.month,&l_time.day);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index cd57c280950..7c07b4f8847 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -3057,6 +3057,12 @@ end_with_restore_list:
}
}
/* Don't yet allow changing of symlinks with ALTER TABLE */
+ if (lex->create_info.data_file_name)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+ "DATA DIRECTORY option ignored");
+ if (lex->create_info.index_file_name)
+ push_warning(thd, MYSQL_ERROR::WARN_LEVEL_WARN, 0,
+ "INDEX DIRECTORY option ignored");
lex->create_info.data_file_name=lex->create_info.index_file_name=0;
/* ALTER TABLE ends previous transaction */
if (end_active_trans(thd))
diff --git a/strings/strtod.c b/strings/strtod.c
index 61f2c107abe..da1b4f4baa6 100644
--- a/strings/strtod.c
+++ b/strings/strtod.c
@@ -26,8 +26,8 @@
*/
-#include "my_base.h" /* Includes errno.h */
-#include "m_ctype.h"
+#include <my_global.h> /* Includes errno.h */
+#include <m_ctype.h>
#define MAX_DBL_EXP 308
#define MAX_RESULT_FOR_MAX_EXP 1.79769313486232