Commit 0156ccdc authored by Chad MILLER's avatar Chad MILLER

Merge from 5.0-bugteam.

parents 2dcc449f 0546add3
[MYSQL]
post_commit_to = "commits@lists.mysql.com"
post_push_to = "commits@lists.mysql.com"
tree_name = "mysql-5.1-bugteam"
tree_name = "mysql-5.1"
......@@ -1009,13 +1009,13 @@ 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. ");
INSERT INTO federated.t1 VALUES(4, "Die bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest fr jemanden, der seine Zielsprache ernst nimmt:");
INSERT INTO federated.t1 VALUES(4, "Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:");
SELECT * FROM federated.t1;
blurb_id blurb
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.
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.
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.
4 Die bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest fr jemanden, der seine Zielsprache ernst nimmt:
4 Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:
DROP TABLE IF EXISTS federated.t1;
CREATE TABLE federated.t1 (
`a` int NOT NULL,
......@@ -2118,11 +2118,22 @@ DROP TABLE t1;
DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
DROP TABLE t1;
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
End of 5.1 tests
CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
CREATE TABLE t1
(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:SLAVE_PORT/test/t1';
CHECKSUM TABLE t1;
Table Checksum
test.t1 2465757603
DROP TABLE t1;
DROP TABLE t1;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
DROP TABLE IF EXISTS federated.t1;
DROP DATABASE IF EXISTS federated;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
End of 5.1 tests
......@@ -2372,3 +2372,28 @@ a MIN(b) MAX(b) AVG(b)
2 1 3 2.0000
1 1 3 2.0000
DROP TABLE t1;
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
insert into t1 (a,b) values (0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7),
(0,8),(0,9),(0,10),(0,11);
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
select * from t1;
a b
0 0
0 1
0 2
0 3
0 4
0 5
0 6
0 7
0 8
0 9
0 10
0 11
0 12
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range PRIMARY,index PRIMARY 4 NULL 5 Using where; Using index for group-by; Using temporary
Warnings:
Note 1003 select sql_buffer_result `test`.`t1`.`a` AS `a`,(max(`test`.`t1`.`b`) + 1) AS `max(b)+1` from `test`.`t1` where (`test`.`t1`.`a` = 0) group by `test`.`t1`.`a`
drop table t1;
......@@ -682,7 +682,7 @@ eval CREATE TABLE federated.t1 (
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. ");
INSERT INTO federated.t1 VALUES(4, "Die bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest fr jemanden, der seine Zielsprache ernst nimmt:");
INSERT INTO federated.t1 VALUES(4, "Die �bersetzung einer so umfangreichen technischen Dokumentation wie des MySQL-Referenzhandbuchs ist schon eine besondere Herausforderung. Zumindest f�r jemanden, der seine Zielsprache ernst nimmt:");
SELECT * FROM federated.t1;
connection slave;
......@@ -1075,20 +1075,20 @@ SELECT HEX(a) FROM federated.t1;
# CREATE TABLE federated.t1 (a char(20)) charset=cp1251;
# #
# connection master;
# INSERT INTO federated.t1 values (_cp1251'--1');
# INSERT INTO federated.t1 values (_cp1251'--2');
# INSERT INTO federated.t1 values (_cp1251'�-���-1');
# INSERT INTO federated.t1 values (_cp1251'�-���-2');
# SELECT * FROM federated.t1;
# SET names cp1251;
# INSERT INTO federated.t1 values ('--3');
# INSERT INTO federated.t1 values ('-Ũ-4');
# INSERT INTO federated.t1 values ('�-���-3');
# INSERT INTO federated.t1 values ('�-Ũ�-4');
# SELECT * FROM federated.t1;
# SELECT hex(a) from federated.t1;
# SELECT hex(a) from federated.t1 ORDER BY a desc;
# UPDATE federated.t1 SET a='--1' WHERE a='--1';
# UPDATE federated.t1 SET a='�-���-1�����' WHERE a='�-���-1';
# SELECT * FROM federated.t1;
# DELETE FROM federated.t1 WHERE a='-Ũ-4';
# DELETE FROM federated.t1 WHERE a='�-Ũ�-4';
# SELECT * FROM federated.t1;
# DELETE FROM federated.t1 WHERE a>'-';
# DELETE FROM federated.t1 WHERE a>'�-';
# SELECT * FROM federated.t1;
# SET names default;
# DROP TABLE IF EXISTS federated.t1;
......@@ -1857,15 +1857,30 @@ DROP TABLE t1;
CREATE TABLE t1 (a INT) ENGINE=federated CONNECTION='mysql://@:://';
DROP TABLE t1;
#
# Coverage testing of CREATE SERVER.
# Bug #34779: crash in checksum table on federated tables with blobs
# containing nulls
#
connection slave;
CREATE TABLE t1 (a LONGBLOB, b LONGBLOB);
INSERT INTO t1 VALUES ('aaaaaaaaaaaaaaaaaaaaaaaaaaaa', NULL);
connection master;
--replace_result $SLAVE_MYPORT SLAVE_PORT
eval CREATE TABLE t1
(a LONGBLOB, b LONGBLOB) ENGINE=FEDERATED
CONNECTION='mysql://root@127.0.0.1:$SLAVE_MYPORT/test/t1';
CHECKSUM TABLE t1;
connection slave;
DROP TABLE t1;
connection master;
DROP TABLE t1;
connection default;
--echo End of 5.0 tests
create server 's1' foreign data wrapper 'mysql' options (port 3306);
drop server 's1';
--echo End of 5.1 tests
source include/federated_cleanup.inc;
connection default;
SET @@GLOBAL.CONCURRENT_INSERT= @OLD_CONCURRENT_INSERT;
......@@ -942,3 +942,15 @@ SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
SELECT a, MIN(b), MAX(b), AVG(b) FROM t1 GROUP BY a ORDER BY a DESC;
DROP TABLE t1;
#
# Bug#38195: Incorrect handling of aggregate functions when loose index scan is
# used causes server crash.
#
create table t1 (a int, b int, primary key (a,b), key `index` (a,b)) engine=MyISAM;
insert into t1 (a,b) values (0,0),(0,1),(0,2),(0,3),(0,4),(0,5),(0,6),(0,7),
(0,8),(0,9),(0,10),(0,11);
insert into t1 (a,b) select a, max(b)+1 from t1 where a = 0 group by a;
select * from t1;
explain extended select sql_buffer_result a, max(b)+1 from t1 where a = 0 group by a;
drop table t1;
......@@ -1794,7 +1794,8 @@ JOIN::exec()
if (!items1)
{
items1= items0 + all_fields.elements;
if (sort_and_group || curr_tmp_table->group)
if (sort_and_group || curr_tmp_table->group ||
tmp_table_param.precomputed_group_by)
{
if (change_to_use_tmp_fields(thd, items1,
tmp_fields_list1, tmp_all_fields1,
......@@ -9628,6 +9629,8 @@ create_tmp_table(THD *thd,TMP_TABLE_PARAM *param,List<Item> &fields,
MI_COLUMNDEF *recinfo;
uint total_uneven_bit_length= 0;
bool force_copy_fields= param->force_copy_fields;
/* Treat sum functions as normal ones when loose index scan is used. */
save_sum_fields|= param->precomputed_group_by;
DBUG_ENTER("create_tmp_table");
DBUG_PRINT("enter",
("distinct: %d save_sum_fields: %d rows_limit: %lu group: %d",
......
......@@ -920,7 +920,10 @@ uint ha_federated::convert_row_to_internal_format(uchar *record,
old_ptr= (my_ptrdiff_t) (record - table->record[0]);
(*field)->move_field_offset(old_ptr);
if (!*row)
{
(*field)->set_null();
(*field)->reset();
}
else
{
if (bitmap_is_set(table->read_set, (*field)->field_index))
......
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