1
0
mirror of https://github.com/MariaDB/server.git synced 2025-12-24 11:21:21 +03:00

Fixed stack overrun with some INSERT ... SELECT ... GROUP BY queries (Bug #3265)

Ensure that raid_chunks is not set to higher than 255 as this could cause problems with DROP DATABASE. (Bug #3182)


mysql-test/r/raid.result:
  Test of raid_chunks > 255
mysql-test/t/raid.test:
  Test of raid_chunks > 255
sql/item.cc:
  Fixed wrong usage of str_value in Item::save_in_field
  This could caused a stack overrun with some very special INSERT ... SELECT ... GROUP BY queries where the GROUP BY value was an expression that generated a NULL value. (Bug #3265)
  The Item_copy_string::save_in_field() function is from 4.1 and helps optimized this case a bit
sql/item.h:
  Fixed wrong usage of str_value in Item_copy_string::save_in_field
sql/sql_insert.cc:
  More debug information
sql/table.cc:
  Ensure that raid_chunks is not set to higher than 255 as this could cause problems with DROP DATABASE.
  Another problem with values > 255 is that in the .frm file we store the chunks value in one byte.
  (Bug #3182)
This commit is contained in:
unknown
2004-04-28 03:37:45 +03:00
parent b825d9b023
commit b0a8fde897
6 changed files with 42 additions and 5 deletions

View File

@@ -2,6 +2,14 @@ create database test_raid;
create table test_raid.r1 (i int) raid_type=1;
create table test_raid.r2 (i int) raid_type=1 raid_chunks=32;
drop database test_raid;
create database test_raid;
create table test_raid.r2 (i int) raid_type=1 raid_chunks=257;
show create table test_raid.r2;
Table Create Table
r2 CREATE TABLE `r2` (
`i` int(11) default NULL
) TYPE=MyISAM RAID_TYPE=striped RAID_CHUNKS=255 RAID_CHUNKSIZE=256
drop database test_raid;
DROP TABLE IF EXISTS t1,t2;
CREATE TABLE t1 (
id int unsigned not null auto_increment primary key,