Commit 3a537679 authored by Michael Widenius's avatar Michael Widenius

automatic merge

parents c735c1b7 f940c2ca
......@@ -444,9 +444,9 @@ column_get(column_create(1, "8:46:06.23434" AS time), 1 as double)
select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double);
column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double)
20110405084606.2
select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6));
column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6))
20110405084606.234375
select round(column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6)),3);
round(column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6)),3)
20110405084606.234
select column_get(column_create(1, NULL AS double), 1 as double);
column_get(column_create(1, NULL AS double), 1 as double)
NULL
......@@ -1228,3 +1228,9 @@ NULL NULL
0002000100030200230861626308636465 2
SELECT COLUMN_ADD(f1, 1, 'abc'), COLUMN_LIST(f1) FROM t1;
DROP TABLE t1;
#
# Some dynamic strings that caused crashes in the past
#
set @a=0x0102000200030004000F0D086B74697A6A7176746F6B687563726A746E7A746A666163726C6F7A6B62636B6B756B666779666977617369796F67756C726D62677A72756E63626D78636D7077706A6F736C6D636464696770786B6371637A6A6A6463737A6A676879716462637178646C666E6B6C726A637677696E7271746C616D646368687A6C707869786D666F666261797470616A63797673737A796D74747475666B717573687A79696E7276706F796A6E767361796A6F6D646F6378677A667074746363736A796D67746C786F697873686464616265616A7A6F7168707A6B776B6376737A6B72666C6F666C69636163686F6B666D627166786A71616F;
select column_add(@a, 3, "a");
ERROR HY000: Encountered illegal format of dynamic column string
......@@ -371,7 +371,7 @@ EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where; Rowid-ordered scan
1 SIMPLE City range Population,Name,Country Name # NULL # Using index condition; Using where; Rowid-ordered scan
SELECT * FROM City USE INDEX ()
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
ID Name Country Population
......
......@@ -372,7 +372,7 @@ EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL # Using sort_intersect(Population,Name,Country); Using where
1 SIMPLE City index_merge Population,Name,Country Population,Name,Country # NULL # Using sort_intersect(Population,Name,Country); Using where
SELECT * FROM City USE INDEX ()
WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%';
ID Name Country Population
......
......@@ -86,6 +86,7 @@ select column_get(column_create(1, -1212 AS int), 1 as unsigned int);
select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1 as unsigned int);
select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as unsigned int);
select column_get(column_create(1, -1 AS decimal), 1 as unsigned int);
--replace_result 1e+029 1e+29
select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as unsigned int);
select column_get(column_create(1, 999.9 AS double), 1 as unsigned int);
select column_get(column_create(1, -1 AS double), 1 as unsigned int);
......@@ -115,6 +116,7 @@ select column_get(column_create(1, 99999999999999999999999999999 AS decimal), 1
select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1 as int);
select column_get(column_create(1, 999.9999999999999999 AS decimal), 1 as int);
select column_get(column_create(1, 999.9 AS double), 1 as int);
--replace_result 1e+029 1e+29
select column_get(column_create(1, -99999999999999999999999999999 AS double), 1 as int);
select column_get(column_create(1, "-1212III" AS char), 1 as int);
select column_get(column_create(1, "1212III" AS char), 1 as int);
......@@ -161,7 +163,8 @@ select column_get(column_create(1, -99999999999999999999999999999 AS decimal), 1
select column_get(column_create(1, "2011-04-05" AS date), 1 as double);
select column_get(column_create(1, "8:46:06.23434" AS time), 1 as double);
select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double);
select column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6));
# The replace result is needed for windows.
select round(column_get(column_create(1, "2011-04-05 8:46:06.23434" AS datetime), 1 as double(20,6)),3);
select column_get(column_create(1, NULL AS double), 1 as double);
-- echo # column get real truncation & warnings
......@@ -241,6 +244,7 @@ select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as d
select column_get(column_create(1, 9223372036854775807 AS int), 1 as datetime);
select column_get(column_create(1, -9223372036854775808 AS int), 1 as datetime);
select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as datetime);
--replace_result 1e+028 1e+28
select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as datetime);
select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as datetime);
select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as datetime);
......@@ -286,6 +290,7 @@ select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as d
select column_get(column_create(1, 9223372036854775807 AS int), 1 as date);
select column_get(column_create(1, -9223372036854775808 AS int), 1 as date);
select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as date);
--replace_result 1e+028 1e+28
select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as date);
select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as date);
select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as date);
......@@ -330,6 +335,7 @@ select column_get(column_create(1, 18446744073709551615 AS unsigned int), 1 as t
select column_get(column_create(1, 9223372036854775807 AS int), 1 as time);
select column_get(column_create(1, -9223372036854775808 AS int), 1 as time);
select column_get(column_create(1, 99999999999999999999999999999 AS decimal(32,10)), 1 as time);
--replace_result 1e+028 1e+28
select column_get(column_create(1, 99999999999999999999999999999 AS double), 1 as time);
select column_get(column_create(1, "2011-02-32 8:46:06.23434" AS CHAR), 1 as time);
select column_get(column_create(1, "2011-13-01 8:46:06.23434" AS CHAR), 1 as time);
......@@ -492,3 +498,11 @@ SELECT HEX(COLUMN_ADD(f1, 1, 'abc')), COLUMN_LIST(f1) FROM t1;
SELECT COLUMN_ADD(f1, 1, 'abc'), COLUMN_LIST(f1) FROM t1;
--enable_result_log
DROP TABLE t1;
--echo #
--echo # Some dynamic strings that caused crashes in the past
--echo #
set @a=0x0102000200030004000F0D086B74697A6A7176746F6B687563726A746E7A746A666163726C6F7A6B62636B6B756B666779666977617369796F67756C726D62677A72756E63626D78636D7077706A6F736C6D636464696770786B6371637A6A6A6463737A6A676879716462637178646C666E6B6C726A637677696E7271746C616D646368687A6C707869786D666F666261797470616A63797673737A796D74747475666B717573687A79696E7276706F796A6E767361796A6F6D646F6378677A667074746363736A796D67746C786F697873686464616265616A7A6F7168707A6B776B6376737A6B72666C6F666C69636163686F6B666D627166786A71616F;
--error ER_DYN_COL_WRONG_FORMAT
select column_add(@a, 3, "a");
......@@ -136,7 +136,8 @@ EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'J' AND Population > 1000000 AND Country LIKE 'B%';
--replace_column 9 #
--replace_column 7 # 9 #
--replace_result Population,Country,Name Population,Name,Country
EXPLAIN
SELECT * FROM City
WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%';
......
......@@ -912,6 +912,7 @@ static void type_and_offset_read(DYNAMIC_COLUMN_TYPE *type,
uchar *place, size_t offset_size)
{
ulong val;
LINT_INIT(val);
place+= COLUMN_NUMBER_SIZE; /* skip column number */
switch (offset_size) {
......@@ -1618,6 +1619,7 @@ find_place(uint num, uchar *header, size_t entry_size,
{
uint mid, start, end, val;
int flag;
LINT_INIT(flag); /* 100 % safe */
start= 0;
end= column_count -1;
......@@ -1968,6 +1970,13 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
type_and_offset_read(&tp, &offs, read, offset_size);
if (k == start)
first_offset= offs;
else if (offs < first_offset)
{
dynamic_column_column_free(&tmp);
rc= ER_DYNCOL_FORMAT;
goto end;
}
offs+= plan[i].ddelta;
int2store(write, nm);
/* write rest of data at write + COLUMN_NUMBER_SIZE */
......@@ -1984,7 +1993,8 @@ dynamic_column_update_many(DYNAMIC_COLUMN *str,
get_length_interval(header_base + start * entry_size,
header_base + end * entry_size,
header_end, offset_size, max_offset);
if ((long) data_size < 0)
if ((long) data_size < 0 ||
data_size > max_offset - first_offset)
{
dynamic_column_column_free(&tmp);
rc= ER_DYNCOL_FORMAT;
......
......@@ -761,6 +761,7 @@ bool key_buf_cmp(KEY *key_info, uint used_key_parts,
LINT_INIT(cs);
LINT_INIT(length1);
LINT_INIT(length2);
LINT_INIT(pack_length);
key1+= key_part->length;
key2+= key_part->length;
......
......@@ -4661,7 +4661,7 @@ int main(int argc, char **argv)
#ifndef DBUG_OFF
test_lc_time_sz();
srand(time(NULL));
srand((uint) time(NULL));
#endif
/*
......
......@@ -67,7 +67,6 @@ vi\.c : unused parameter
common\.c : unused parameter
term\.c : .*
#
# Ignore some warnings in libevent, which is not maintained by us.
#
......@@ -146,6 +145,7 @@ table_xt\.cc : variable.*might be clobbered by.*longjmp
#
# Yassl
#
include/runtime.hpp: .*pure_error.*
.*/extra/yassl/.*taocrypt/.*: comparison with string literal
.*/extra/yassl/taocrypt/src/blowfish\.cpp: array subscript is above array bounds
......@@ -158,6 +158,12 @@ mySTL/algorithm\.hpp: is used uninitialized in this function
#
.*/dbug/.*(groff|<standard input>) : .*
#
# Warnings on OpenSolaris
#
.*/my_config\.h : _FILE_OFFSET_BITS
/usr/include/sys/feature_tests.h : this is the location of the previous definition
#
# Unexplanable (?) stuff
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment