Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0-icc
This commit is contained in:
commit
26b3ef7f44
@ -1092,7 +1092,7 @@ int chk_data_link(MI_CHECK *param, MI_INFO *info,int extend)
|
|||||||
"Keypointers and record positions doesn't match");
|
"Keypointers and record positions doesn't match");
|
||||||
error=1;
|
error=1;
|
||||||
}
|
}
|
||||||
else if (param->glob_crc != info->s->state.checksum &&
|
else if (param->glob_crc != info->state->checksum &&
|
||||||
(info->s->options &
|
(info->s->options &
|
||||||
(HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)))
|
(HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD)))
|
||||||
{
|
{
|
||||||
@ -1388,7 +1388,7 @@ int mi_repair(MI_CHECK *param, register MI_INFO *info,
|
|||||||
info->state->data_file_length=sort_param.max_pos;
|
info->state->data_file_length=sort_param.max_pos;
|
||||||
}
|
}
|
||||||
if (param->testflag & T_CALC_CHECKSUM)
|
if (param->testflag & T_CALC_CHECKSUM)
|
||||||
share->state.checksum=param->glob_crc;
|
info->state->checksum=param->glob_crc;
|
||||||
|
|
||||||
if (!(param->testflag & T_SILENT))
|
if (!(param->testflag & T_SILENT))
|
||||||
{
|
{
|
||||||
@ -2156,7 +2156,7 @@ int mi_repair_by_sort(MI_CHECK *param, register MI_INFO *info,
|
|||||||
my_errno);
|
my_errno);
|
||||||
}
|
}
|
||||||
if (param->testflag & T_CALC_CHECKSUM)
|
if (param->testflag & T_CALC_CHECKSUM)
|
||||||
share->state.checksum=param->glob_crc;
|
info->state->checksum=param->glob_crc;
|
||||||
|
|
||||||
if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
|
if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
|
||||||
mi_check_print_warning(param,
|
mi_check_print_warning(param,
|
||||||
@ -2577,7 +2577,7 @@ int mi_repair_parallel(MI_CHECK *param, register MI_INFO *info,
|
|||||||
my_errno);
|
my_errno);
|
||||||
}
|
}
|
||||||
if (param->testflag & T_CALC_CHECKSUM)
|
if (param->testflag & T_CALC_CHECKSUM)
|
||||||
share->state.checksum=param->glob_crc;
|
info->state->checksum=param->glob_crc;
|
||||||
|
|
||||||
if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
|
if (my_chsize(share->kfile,info->state->key_file_length,0,MYF(0)))
|
||||||
mi_check_print_warning(param,
|
mi_check_print_warning(param,
|
||||||
@ -3808,7 +3808,7 @@ int recreate_table(MI_CHECK *param, MI_INFO **org_info, char *filename)
|
|||||||
(*org_info)->s->state.create_time=share.state.create_time;
|
(*org_info)->s->state.create_time=share.state.create_time;
|
||||||
(*org_info)->s->state.unique=(*org_info)->this_unique=
|
(*org_info)->s->state.unique=(*org_info)->this_unique=
|
||||||
share.state.unique;
|
share.state.unique;
|
||||||
(*org_info)->s->state.checksum=share.state.checksum;
|
(*org_info)->state->checksum=info.state->checksum;
|
||||||
(*org_info)->state->del=info.state->del;
|
(*org_info)->state->del=info.state->del;
|
||||||
(*org_info)->s->state.dellink=share.state.dellink;
|
(*org_info)->s->state.dellink=share.state.dellink;
|
||||||
(*org_info)->state->empty=info.state->empty;
|
(*org_info)->state->empty=info.state->empty;
|
||||||
|
@ -93,7 +93,7 @@ int mi_delete(MI_INFO *info,const byte *record)
|
|||||||
|
|
||||||
if ((*share->delete_record)(info))
|
if ((*share->delete_record)(info))
|
||||||
goto err; /* Remove record from database */
|
goto err; /* Remove record from database */
|
||||||
info->s->state.checksum-=info->checksum;
|
info->state->checksum-=info->checksum;
|
||||||
|
|
||||||
info->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED;
|
info->update= HA_STATE_CHANGED+HA_STATE_DELETED+HA_STATE_ROW_CHANGED;
|
||||||
info->state->records--;
|
info->state->records--;
|
||||||
|
@ -41,7 +41,7 @@ int mi_delete_all_rows(MI_INFO *info)
|
|||||||
info->state->key_file_length=share->base.keystart;
|
info->state->key_file_length=share->base.keystart;
|
||||||
info->state->data_file_length=0;
|
info->state->data_file_length=0;
|
||||||
info->state->empty=info->state->key_empty=0;
|
info->state->empty=info->state->key_empty=0;
|
||||||
state->checksum=0;
|
info->state->checksum=0;
|
||||||
|
|
||||||
for (i=share->base.max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; )
|
for (i=share->base.max_key_block_length/MI_MIN_KEY_BLOCK_LENGTH ; i-- ; )
|
||||||
state->key_del[i]= HA_OFFSET_ERROR;
|
state->key_del[i]= HA_OFFSET_ERROR;
|
||||||
|
@ -823,7 +823,7 @@ uint mi_state_info_write(File file, MI_STATE_INFO *state, uint pWrite)
|
|||||||
mi_sizestore(ptr,state->state.empty); ptr +=8;
|
mi_sizestore(ptr,state->state.empty); ptr +=8;
|
||||||
mi_sizestore(ptr,state->state.key_empty); ptr +=8;
|
mi_sizestore(ptr,state->state.key_empty); ptr +=8;
|
||||||
mi_int8store(ptr,state->auto_increment); ptr +=8;
|
mi_int8store(ptr,state->auto_increment); ptr +=8;
|
||||||
mi_int8store(ptr,(ulonglong) state->checksum);ptr +=8;
|
mi_int8store(ptr,(ulonglong) state->state.checksum);ptr +=8;
|
||||||
mi_int4store(ptr,state->process); ptr +=4;
|
mi_int4store(ptr,state->process); ptr +=4;
|
||||||
mi_int4store(ptr,state->unique); ptr +=4;
|
mi_int4store(ptr,state->unique); ptr +=4;
|
||||||
mi_int4store(ptr,state->status); ptr +=4;
|
mi_int4store(ptr,state->status); ptr +=4;
|
||||||
@ -885,7 +885,7 @@ uchar *mi_state_info_read(uchar *ptr, MI_STATE_INFO *state)
|
|||||||
state->state.empty = mi_sizekorr(ptr); ptr +=8;
|
state->state.empty = mi_sizekorr(ptr); ptr +=8;
|
||||||
state->state.key_empty= mi_sizekorr(ptr); ptr +=8;
|
state->state.key_empty= mi_sizekorr(ptr); ptr +=8;
|
||||||
state->auto_increment=mi_uint8korr(ptr); ptr +=8;
|
state->auto_increment=mi_uint8korr(ptr); ptr +=8;
|
||||||
state->checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8;
|
state->state.checksum=(ha_checksum) mi_uint8korr(ptr); ptr +=8;
|
||||||
state->process= mi_uint4korr(ptr); ptr +=4;
|
state->process= mi_uint4korr(ptr); ptr +=4;
|
||||||
state->unique = mi_uint4korr(ptr); ptr +=4;
|
state->unique = mi_uint4korr(ptr); ptr +=4;
|
||||||
state->status = mi_uint4korr(ptr); ptr +=4;
|
state->status = mi_uint4korr(ptr); ptr +=4;
|
||||||
|
@ -162,7 +162,7 @@ int mi_update(register MI_INFO *info, const byte *oldrec, byte *newrec)
|
|||||||
if (auto_key_changed)
|
if (auto_key_changed)
|
||||||
update_auto_increment(info,newrec);
|
update_auto_increment(info,newrec);
|
||||||
if (share->calc_checksum)
|
if (share->calc_checksum)
|
||||||
share->state.checksum+=(info->checksum - old_checksum);
|
info->state->checksum+=(info->checksum - old_checksum);
|
||||||
|
|
||||||
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV |
|
info->update= (HA_STATE_CHANGED | HA_STATE_ROW_CHANGED | HA_STATE_AKTIV |
|
||||||
key_changed);
|
key_changed);
|
||||||
|
@ -142,7 +142,7 @@ int mi_write(MI_INFO *info, byte *record)
|
|||||||
{
|
{
|
||||||
if ((*share->write_record)(info,record))
|
if ((*share->write_record)(info,record))
|
||||||
goto err;
|
goto err;
|
||||||
share->state.checksum+=info->checksum;
|
info->state->checksum+=info->checksum;
|
||||||
}
|
}
|
||||||
if (share->base.auto_key)
|
if (share->base.auto_key)
|
||||||
update_auto_increment(info,record);
|
update_auto_increment(info,record);
|
||||||
|
@ -1261,7 +1261,7 @@ static void descript(MI_CHECK *param, register MI_INFO *info, my_string name)
|
|||||||
share->base.raid_chunksize);
|
share->base.raid_chunksize);
|
||||||
}
|
}
|
||||||
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
|
if (share->options & (HA_OPTION_CHECKSUM | HA_OPTION_COMPRESS_RECORD))
|
||||||
printf("Checksum: %23s\n",llstr(info->s->state.checksum,llbuff));
|
printf("Checksum: %23s\n",llstr(info->state->checksum,llbuff));
|
||||||
;
|
;
|
||||||
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
|
if (share->options & HA_OPTION_DELAY_KEY_WRITE)
|
||||||
printf("Keys are only flushed at close\n");
|
printf("Keys are only flushed at close\n");
|
||||||
@ -1576,7 +1576,7 @@ static int mi_sort_records(MI_CHECK *param,
|
|||||||
old_record_count=info->state->records;
|
old_record_count=info->state->records;
|
||||||
info->state->records=0;
|
info->state->records=0;
|
||||||
if (sort_info.new_data_file_type != COMPRESSED_RECORD)
|
if (sort_info.new_data_file_type != COMPRESSED_RECORD)
|
||||||
share->state.checksum=0;
|
info->state->checksum=0;
|
||||||
|
|
||||||
if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key],
|
if (sort_record_index(&sort_param,info,keyinfo,share->state.key_root[sort_key],
|
||||||
temp_buff, sort_key,new_file,update_index) ||
|
temp_buff, sort_key,new_file,update_index) ||
|
||||||
|
@ -38,6 +38,7 @@ typedef struct st_mi_status_info
|
|||||||
my_off_t key_empty; /* lost space in indexfile */
|
my_off_t key_empty; /* lost space in indexfile */
|
||||||
my_off_t key_file_length;
|
my_off_t key_file_length;
|
||||||
my_off_t data_file_length;
|
my_off_t data_file_length;
|
||||||
|
ha_checksum checksum;
|
||||||
} MI_STATUS_INFO;
|
} MI_STATUS_INFO;
|
||||||
|
|
||||||
typedef struct st_mi_state_info
|
typedef struct st_mi_state_info
|
||||||
@ -75,7 +76,6 @@ typedef struct st_mi_state_info
|
|||||||
ulong sec_index_changed; /* Updated when new sec_index */
|
ulong sec_index_changed; /* Updated when new sec_index */
|
||||||
ulong sec_index_used; /* which extra index are in use */
|
ulong sec_index_used; /* which extra index are in use */
|
||||||
ulonglong key_map; /* Which keys are in use */
|
ulonglong key_map; /* Which keys are in use */
|
||||||
ha_checksum checksum;
|
|
||||||
ulong version; /* timestamp of create */
|
ulong version; /* timestamp of create */
|
||||||
time_t create_time; /* Time when created database */
|
time_t create_time; /* Time when created database */
|
||||||
time_t recover_time; /* Time for last recover */
|
time_t recover_time; /* Time for last recover */
|
||||||
|
@ -2967,7 +2967,7 @@ static int save_state(MI_INFO *isam_file,PACK_MRG_INFO *mrg,my_off_t new_length,
|
|||||||
share->state.key_root[key]= HA_OFFSET_ERROR;
|
share->state.key_root[key]= HA_OFFSET_ERROR;
|
||||||
for (key=0 ; key < share->state.header.max_block_size ; key++)
|
for (key=0 ; key < share->state.header.max_block_size ; key++)
|
||||||
share->state.key_del[key]= HA_OFFSET_ERROR;
|
share->state.key_del[key]= HA_OFFSET_ERROR;
|
||||||
share->state.checksum=crc; /* Save crc here */
|
isam_file->state->checksum=crc; /* Save crc here */
|
||||||
share->changed=1; /* Force write of header */
|
share->changed=1; /* Force write of header */
|
||||||
share->state.open_count=0;
|
share->state.open_count=0;
|
||||||
share->global_changed=0;
|
share->global_changed=0;
|
||||||
@ -3003,7 +3003,7 @@ static int save_state_mrg(File file,PACK_MRG_INFO *mrg,my_off_t new_length,
|
|||||||
state.dellink= HA_OFFSET_ERROR;
|
state.dellink= HA_OFFSET_ERROR;
|
||||||
state.version=(ulong) time((time_t*) 0);
|
state.version=(ulong) time((time_t*) 0);
|
||||||
mi_clear_all_keys_active(state.key_map);
|
mi_clear_all_keys_active(state.key_map);
|
||||||
state.checksum=crc;
|
state.state.checksum=crc;
|
||||||
if (isam_file->s->base.keys)
|
if (isam_file->s->base.keys)
|
||||||
isamchk_neaded=1;
|
isamchk_neaded=1;
|
||||||
state.changed=STATE_CHANGED | STATE_NOT_ANALYZED; /* Force check of table */
|
state.changed=STATE_CHANGED | STATE_NOT_ANALYZED; /* Force check of table */
|
||||||
|
@ -2625,11 +2625,11 @@ test.test_checksum 1531596814
|
|||||||
insert into test_checksum values(3);
|
insert into test_checksum values(3);
|
||||||
checksum table test_checksum;
|
checksum table test_checksum;
|
||||||
Table Checksum
|
Table Checksum
|
||||||
test.test_checksum 1531596814
|
test.test_checksum 2605035534
|
||||||
commit;
|
commit;
|
||||||
checksum table test_checksum;
|
checksum table test_checksum;
|
||||||
Table Checksum
|
Table Checksum
|
||||||
test.test_checksum 2050879373
|
test.test_checksum 127268899
|
||||||
commit;
|
commit;
|
||||||
drop table test_checksum;
|
drop table test_checksum;
|
||||||
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1;
|
||||||
@ -2642,5 +2642,5 @@ set autocommit=1;
|
|||||||
insert into test_checksum values(3);
|
insert into test_checksum values(3);
|
||||||
checksum table test_checksum;
|
checksum table test_checksum;
|
||||||
Table Checksum
|
Table Checksum
|
||||||
test.test_checksum 2050879373
|
test.test_checksum 127268899
|
||||||
drop table test_checksum;
|
drop table test_checksum;
|
||||||
|
@ -1735,22 +1735,65 @@ create view v1 as
|
|||||||
select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
|
select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
|
||||||
create view v2 as
|
create view v2 as
|
||||||
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
||||||
drop view v1, v2, v3;
|
|
||||||
drop table t1;
|
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
|
||||||
show full tables;
|
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
|
||||||
Tables_in_test Table_type
|
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
|
||||||
t1 BASE TABLE
|
/*!40101 SET NAMES utf8 */;
|
||||||
v1 VIEW
|
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
|
||||||
v2 VIEW
|
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
|
||||||
v3 VIEW
|
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
|
||||||
show create view v1;
|
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
|
||||||
View Create View
|
DROP TABLE IF EXISTS `t1`;
|
||||||
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7))
|
CREATE TABLE `t1` (
|
||||||
select * from v1;
|
`a` int(11) default NULL,
|
||||||
a b c
|
`b` int(11) default NULL,
|
||||||
1 2 one
|
`c` varchar(30) default NULL
|
||||||
2 4 two
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
|
||||||
3 6 three
|
|
||||||
|
|
||||||
|
/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
|
||||||
|
LOCK TABLES `t1` WRITE;
|
||||||
|
INSERT INTO `t1` VALUES (1,2,'one'),(2,4,'two'),(3,6,'three');
|
||||||
|
UNLOCK TABLES;
|
||||||
|
/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
|
||||||
|
DROP TABLE IF EXISTS `v1`;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||||
|
/*!50001 CREATE TABLE `v1` (
|
||||||
|
`a` int(11) default NULL,
|
||||||
|
`b` int(11) default NULL,
|
||||||
|
`c` varchar(30) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
|
||||||
|
DROP TABLE IF EXISTS `v2`;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||||
|
/*!50001 CREATE TABLE `v2` (
|
||||||
|
`a` int(11) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
|
||||||
|
DROP TABLE IF EXISTS `v3`;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||||
|
/*!50001 CREATE TABLE `v3` (
|
||||||
|
`a` int(11) default NULL,
|
||||||
|
`b` int(11) default NULL,
|
||||||
|
`c` varchar(30) default NULL
|
||||||
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1*/;
|
||||||
|
/*!50001 DROP TABLE IF EXISTS `v1`*/;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `v1`*/;
|
||||||
|
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `v3`.`a` AS `a`,`v3`.`b` AS `b`,`v3`.`c` AS `c` from `v3` where (`v3`.`b` in (1,2,3,4,5,6,7))*/;
|
||||||
|
/*!50001 DROP TABLE IF EXISTS `v2`*/;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `v2`*/;
|
||||||
|
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v2` AS select `v3`.`a` AS `a` from (`v3` join `v1`) where ((`v1`.`a` = `v3`.`a`) and (`v3`.`b` = 3)) limit 1*/;
|
||||||
|
/*!50001 DROP TABLE IF EXISTS `v3`*/;
|
||||||
|
/*!50001 DROP VIEW IF EXISTS `v3`*/;
|
||||||
|
/*!50001 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v3` AS select `t1`.`a` AS `a`,`t1`.`b` AS `b`,`t1`.`c` AS `c` from `t1`*/;
|
||||||
|
|
||||||
|
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
|
||||||
|
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
|
||||||
|
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
|
||||||
|
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
|
||||||
|
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
|
||||||
|
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
|
||||||
|
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
|
||||||
|
|
||||||
drop view v1, v2, v3;
|
drop view v1, v2, v3;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
CREATE TABLE t1 (a int, b bigint default NULL);
|
CREATE TABLE t1 (a int, b bigint default NULL);
|
||||||
|
@ -73,7 +73,7 @@ Table Create Table
|
|||||||
user CREATE TABLE `user` (
|
user CREATE TABLE `user` (
|
||||||
`Host` char(60) collate utf8_bin NOT NULL default '',
|
`Host` char(60) collate utf8_bin NOT NULL default '',
|
||||||
`User` char(16) collate utf8_bin NOT NULL default '',
|
`User` char(16) collate utf8_bin NOT NULL default '',
|
||||||
`Password` char(41) collate utf8_bin NOT NULL default '',
|
`Password` binary(41) NOT NULL default '',
|
||||||
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
`Select_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||||
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
`Insert_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||||
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
`Update_priv` enum('N','Y') character set utf8 NOT NULL default 'N',
|
||||||
|
@ -476,7 +476,7 @@ ERROR 42000: You have an error in your SQL syntax; check the manual that corresp
|
|||||||
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
|
CREATE TABLE t1 (a_dec DECIMAL(-1,1));
|
||||||
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 '-1,1))' at line 1
|
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 '-1,1))' at line 1
|
||||||
CREATE TABLE t1 (a_dec DECIMAL(0,11));
|
CREATE TABLE t1 (a_dec DECIMAL(0,11));
|
||||||
ERROR 42000: Scale may not be larger than the precision (column 'a_dec').
|
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'a_dec').
|
||||||
create table t1(a decimal(7,3));
|
create table t1(a decimal(7,3));
|
||||||
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
|
insert into t1 values ('1'),('+1'),('-1'),('0000000001'),('+0000000001'),('-0000000001'),('10'),('+10'),('-10'),('0000000010'),('+0000000010'),('-0000000010'),('100'),('+100'),('-100'),('0000000100'),('+0000000100'),('-0000000100'),('1000'),('+1000'),('-1000'),('0000001000'),('+0000001000'),('-0000001000'),('10000'),('+10000'),('-10000'),('0000010000'),('+0000010000'),('-0000010000'),('100000'),('+100000'),('-100000'),('0000100000'),('+0000100000'),('-0000100000'),('1000000'),('+1000000'),('-1000000'),('0001000000'),('+0001000000'),('-0001000000'),('10000000'),('+10000000'),('-10000000'),('0010000000'),('+0010000000'),('-0010000000'),('100000000'),('+100000000'),('-100000000'),('0100000000'),('+0100000000'),('-0100000000'),('1000000000'),('+1000000000'),('-1000000000'),('1000000000'),('+1000000000'),('-1000000000');
|
||||||
select * from t1;
|
select * from t1;
|
||||||
|
@ -226,6 +226,6 @@ reckey recdesc
|
|||||||
109 Has 109 as key
|
109 Has 109 as key
|
||||||
drop table t1;
|
drop table t1;
|
||||||
create table t1 (s1 float(0,2));
|
create table t1 (s1 float(0,2));
|
||||||
ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1').
|
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
|
||||||
create table t1 (s1 float(1,2));
|
create table t1 (s1 float(1,2));
|
||||||
ERROR 42000: For float(M,D) or double(M,D), M must be >= D (column 's1').
|
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 's1').
|
||||||
|
@ -936,7 +936,7 @@ ERROR 42000: Too big scale 31 specified for column 'sl'. Maximum is 30.
|
|||||||
create table t1 (sl decimal(0,38));
|
create table t1 (sl decimal(0,38));
|
||||||
ERROR 42000: Too big scale 38 specified for column 'sl'. Maximum is 30.
|
ERROR 42000: Too big scale 38 specified for column 'sl'. Maximum is 30.
|
||||||
create table t1 (sl decimal(0,30));
|
create table t1 (sl decimal(0,30));
|
||||||
ERROR 42000: Scale may not be larger than the precision (column 'sl').
|
ERROR 42000: For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column 'sl').
|
||||||
create table t1 (sl decimal(5, 5));
|
create table t1 (sl decimal(5, 5));
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@ -758,17 +758,7 @@ select * from v3 where b in (1, 2, 3, 4, 5, 6, 7);
|
|||||||
create view v2 as
|
create view v2 as
|
||||||
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
select v3.a from v3, v1 where v1.a=v3.a and v3.b=3 limit 1;
|
||||||
|
|
||||||
--exec $MYSQL_DUMP test > var/tmp/bug10927.sql
|
--exec $MYSQL_DUMP --skip-comments test
|
||||||
drop view v1, v2, v3;
|
|
||||||
drop table t1;
|
|
||||||
--exec $MYSQL test < var/tmp/bug10927.sql
|
|
||||||
|
|
||||||
# Without dropping the original tables in between
|
|
||||||
--exec $MYSQL_DUMP test > var/tmp/bug10927.sql
|
|
||||||
--exec $MYSQL test < var/tmp/bug10927.sql
|
|
||||||
show full tables;
|
|
||||||
show create view v1;
|
|
||||||
select * from v1;
|
|
||||||
|
|
||||||
drop view v1, v2, v3;
|
drop view v1, v2, v3;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
@ -152,7 +152,7 @@ drop table t1;
|
|||||||
# bug #12694 (float(m,d) specifications)
|
# bug #12694 (float(m,d) specifications)
|
||||||
#
|
#
|
||||||
|
|
||||||
--error 1453
|
--error 1427
|
||||||
create table t1 (s1 float(0,2));
|
create table t1 (s1 float(0,2));
|
||||||
--error 1453
|
--error 1427
|
||||||
create table t1 (s1 float(1,2));
|
create table t1 (s1 float(1,2));
|
||||||
|
@ -161,10 +161,12 @@ KEY_CACHE *dflt_key_cache= &dflt_key_cache_var;
|
|||||||
#define FLUSH_CACHE 2000 /* sort this many blocks at once */
|
#define FLUSH_CACHE 2000 /* sort this many blocks at once */
|
||||||
|
|
||||||
static int flush_all_key_blocks(KEY_CACHE *keycache);
|
static int flush_all_key_blocks(KEY_CACHE *keycache);
|
||||||
|
#ifdef THREAD
|
||||||
static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
|
static void link_into_queue(KEYCACHE_WQUEUE *wqueue,
|
||||||
struct st_my_thread_var *thread);
|
struct st_my_thread_var *thread);
|
||||||
static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
static void unlink_from_queue(KEYCACHE_WQUEUE *wqueue,
|
||||||
struct st_my_thread_var *thread);
|
struct st_my_thread_var *thread);
|
||||||
|
#endif
|
||||||
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
|
static void free_block(KEY_CACHE *keycache, BLOCK_LINK *block);
|
||||||
static void test_key_cache(KEY_CACHE *keycache,
|
static void test_key_cache(KEY_CACHE *keycache,
|
||||||
const char *where, my_bool lock);
|
const char *where, my_bool lock);
|
||||||
@ -215,6 +217,7 @@ static void keycache_debug_print _VARARGS((const char *fmt,...));
|
|||||||
#endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */
|
#endif /* defined(KEYCACHE_DEBUG_LOG) && defined(KEYCACHE_DEBUG) */
|
||||||
|
|
||||||
#if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF)
|
#if defined(KEYCACHE_DEBUG) || !defined(DBUG_OFF)
|
||||||
|
#ifdef THREAD
|
||||||
static long keycache_thread_id;
|
static long keycache_thread_id;
|
||||||
#define KEYCACHE_THREAD_TRACE(l) \
|
#define KEYCACHE_THREAD_TRACE(l) \
|
||||||
KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id))
|
KEYCACHE_DBUG_PRINT(l,("|thread %ld",keycache_thread_id))
|
||||||
@ -226,6 +229,11 @@ static long keycache_thread_id;
|
|||||||
|
|
||||||
#define KEYCACHE_THREAD_TRACE_END(l) \
|
#define KEYCACHE_THREAD_TRACE_END(l) \
|
||||||
KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id))
|
KEYCACHE_DBUG_PRINT(l,("]thread %ld",keycache_thread_id))
|
||||||
|
#else /* THREAD */
|
||||||
|
#define KEYCACHE_THREAD_TRACE(l) KEYCACHE_DBUG_PRINT(l,(""))
|
||||||
|
#define KEYCACHE_THREAD_TRACE_BEGIN(l) KEYCACHE_DBUG_PRINT(l,(""))
|
||||||
|
#define KEYCACHE_THREAD_TRACE_END(l) KEYCACHE_DBUG_PRINT(l,(""))
|
||||||
|
#endif /* THREAD */
|
||||||
#else
|
#else
|
||||||
#define KEYCACHE_THREAD_TRACE_BEGIN(l)
|
#define KEYCACHE_THREAD_TRACE_BEGIN(l)
|
||||||
#define KEYCACHE_THREAD_TRACE_END(l)
|
#define KEYCACHE_THREAD_TRACE_END(l)
|
||||||
@ -492,6 +500,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||||||
|
|
||||||
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
keycache_pthread_mutex_lock(&keycache->cache_lock);
|
||||||
|
|
||||||
|
#ifdef THREAD
|
||||||
wqueue= &keycache->resize_queue;
|
wqueue= &keycache->resize_queue;
|
||||||
thread= my_thread_var;
|
thread= my_thread_var;
|
||||||
link_into_queue(wqueue, thread);
|
link_into_queue(wqueue, thread);
|
||||||
@ -500,6 +509,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||||||
{
|
{
|
||||||
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
keycache->resize_in_flush= 1;
|
keycache->resize_in_flush= 1;
|
||||||
if (flush_all_key_blocks(keycache))
|
if (flush_all_key_blocks(keycache))
|
||||||
@ -512,12 +522,16 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||||||
}
|
}
|
||||||
keycache->resize_in_flush= 0;
|
keycache->resize_in_flush= 0;
|
||||||
keycache->can_be_used= 0;
|
keycache->can_be_used= 0;
|
||||||
|
#ifdef THREAD
|
||||||
while (keycache->cnt_for_resize_op)
|
while (keycache->cnt_for_resize_op)
|
||||||
{
|
{
|
||||||
KEYCACHE_DBUG_PRINT("resize_key_cache: wait",
|
KEYCACHE_DBUG_PRINT("resize_key_cache: wait",
|
||||||
("suspend thread %ld", thread->id));
|
("suspend thread %ld", thread->id));
|
||||||
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(keycache->cnt_for_resize_op == 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
end_key_cache(keycache, 0); /* Don't free mutex */
|
end_key_cache(keycache, 0); /* Don't free mutex */
|
||||||
/* The following will work even if use_mem is 0 */
|
/* The following will work even if use_mem is 0 */
|
||||||
@ -525,6 +539,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
|
|||||||
division_limit, age_threshold);
|
division_limit, age_threshold);
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
|
#ifdef THREAD
|
||||||
unlink_from_queue(wqueue, thread);
|
unlink_from_queue(wqueue, thread);
|
||||||
/* Signal for the next resize request to proceeed if any */
|
/* Signal for the next resize request to proceeed if any */
|
||||||
if (wqueue->last_thread)
|
if (wqueue->last_thread)
|
||||||
@ -533,6 +548,7 @@ finish:
|
|||||||
("thread %ld", wqueue->last_thread->next->id));
|
("thread %ld", wqueue->last_thread->next->id));
|
||||||
keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend);
|
keycache_pthread_cond_signal(&wqueue->last_thread->next->suspend);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
keycache_pthread_mutex_unlock(&keycache->cache_lock);
|
||||||
return blocks;
|
return blocks;
|
||||||
}
|
}
|
||||||
@ -553,6 +569,7 @@ static inline void inc_counter_for_resize_op(KEY_CACHE *keycache)
|
|||||||
*/
|
*/
|
||||||
static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
|
static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
struct st_my_thread_var *last_thread;
|
struct st_my_thread_var *last_thread;
|
||||||
if (!--keycache->cnt_for_resize_op &&
|
if (!--keycache->cnt_for_resize_op &&
|
||||||
(last_thread= keycache->resize_queue.last_thread))
|
(last_thread= keycache->resize_queue.last_thread))
|
||||||
@ -561,6 +578,9 @@ static inline void dec_counter_for_resize_op(KEY_CACHE *keycache)
|
|||||||
("thread %ld", last_thread->next->id));
|
("thread %ld", last_thread->next->id));
|
||||||
keycache_pthread_cond_signal(&last_thread->next->suspend);
|
keycache_pthread_cond_signal(&last_thread->next->suspend);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
keycache->cnt_for_resize_op--;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -650,6 +670,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
|
|||||||
} /* end_key_cache */
|
} /* end_key_cache */
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef THREAD
|
||||||
/*
|
/*
|
||||||
Link a thread into double-linked queue of waiting threads.
|
Link a thread into double-linked queue of waiting threads.
|
||||||
|
|
||||||
@ -786,6 +807,7 @@ static void release_queue(KEYCACHE_WQUEUE *wqueue)
|
|||||||
while (thread != last);
|
while (thread != last);
|
||||||
wqueue->last_thread= NULL;
|
wqueue->last_thread= NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -893,6 +915,7 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
|
|||||||
BLOCK_LINK **pins;
|
BLOCK_LINK **pins;
|
||||||
|
|
||||||
KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests));
|
KEYCACHE_DBUG_ASSERT(! (block->hash_link && block->hash_link->requests));
|
||||||
|
#ifdef THREAD
|
||||||
if (!hot && keycache->waiting_for_block.last_thread)
|
if (!hot && keycache->waiting_for_block.last_thread)
|
||||||
{
|
{
|
||||||
/* Signal that in the LRU warm sub-chain an available block has appeared */
|
/* Signal that in the LRU warm sub-chain an available block has appeared */
|
||||||
@ -929,6 +952,10 @@ static void link_block(KEY_CACHE *keycache, BLOCK_LINK *block, my_bool hot,
|
|||||||
#endif
|
#endif
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#else /* THREAD */
|
||||||
|
KEYCACHE_DBUG_ASSERT(! (!hot && keycache->waiting_for_block.last_thread));
|
||||||
|
/* Condition not transformed using DeMorgan, to keep the text identical */
|
||||||
|
#endif /* THREAD */
|
||||||
pins= hot ? &keycache->used_ins : &keycache->used_last;
|
pins= hot ? &keycache->used_ins : &keycache->used_last;
|
||||||
ins= *pins;
|
ins= *pins;
|
||||||
if (ins)
|
if (ins)
|
||||||
@ -1101,6 +1128,7 @@ static inline void remove_reader(BLOCK_LINK *block)
|
|||||||
|
|
||||||
static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
|
static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
while (block->hash_link->requests)
|
while (block->hash_link->requests)
|
||||||
{
|
{
|
||||||
@ -1111,6 +1139,9 @@ static inline void wait_for_readers(KEY_CACHE *keycache, BLOCK_LINK *block)
|
|||||||
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
keycache_pthread_cond_wait(&thread->suspend, &keycache->cache_lock);
|
||||||
block->condvar= NULL;
|
block->condvar= NULL;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(block->hash_link->requests == 0);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1140,6 +1171,7 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link)
|
|||||||
if ((*hash_link->prev= hash_link->next))
|
if ((*hash_link->prev= hash_link->next))
|
||||||
hash_link->next->prev= hash_link->prev;
|
hash_link->next->prev= hash_link->prev;
|
||||||
hash_link->block= NULL;
|
hash_link->block= NULL;
|
||||||
|
#ifdef THREAD
|
||||||
if (keycache->waiting_for_hash_link.last_thread)
|
if (keycache->waiting_for_hash_link.last_thread)
|
||||||
{
|
{
|
||||||
/* Signal that a free hash link has appeared */
|
/* Signal that a free hash link has appeared */
|
||||||
@ -1175,6 +1207,9 @@ static void unlink_hash(KEY_CACHE *keycache, HASH_LINK *hash_link)
|
|||||||
hash_link);
|
hash_link);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
#else /* THREAD */
|
||||||
|
KEYCACHE_DBUG_ASSERT(! (keycache->waiting_for_hash_link.last_thread));
|
||||||
|
#endif /* THREAD */
|
||||||
hash_link->next= keycache->free_hash_list;
|
hash_link->next= keycache->free_hash_list;
|
||||||
keycache->free_hash_list= hash_link;
|
keycache->free_hash_list= hash_link;
|
||||||
}
|
}
|
||||||
@ -1240,6 +1275,7 @@ restart:
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
/* Wait for a free hash link */
|
/* Wait for a free hash link */
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting"));
|
KEYCACHE_DBUG_PRINT("get_hash_link", ("waiting"));
|
||||||
@ -1252,6 +1288,9 @@ restart:
|
|||||||
keycache_pthread_cond_wait(&thread->suspend,
|
keycache_pthread_cond_wait(&thread->suspend,
|
||||||
&keycache->cache_lock);
|
&keycache->cache_lock);
|
||||||
thread->opt_info= NULL;
|
thread->opt_info= NULL;
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(0);
|
||||||
|
#endif
|
||||||
goto restart;
|
goto restart;
|
||||||
}
|
}
|
||||||
hash_link->file= file;
|
hash_link->file= file;
|
||||||
@ -1363,6 +1402,7 @@ restart:
|
|||||||
/* Wait intil the page is flushed on disk */
|
/* Wait intil the page is flushed on disk */
|
||||||
hash_link->requests--;
|
hash_link->requests--;
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
||||||
do
|
do
|
||||||
@ -1373,6 +1413,16 @@ restart:
|
|||||||
&keycache->cache_lock);
|
&keycache->cache_lock);
|
||||||
}
|
}
|
||||||
while(thread->next);
|
while(thread->next);
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(0);
|
||||||
|
/*
|
||||||
|
Given the use of "resize_in_flush", it seems impossible
|
||||||
|
that this whole branch is ever entered in single-threaded case
|
||||||
|
because "(wrmode && keycache->resize_in_flush)" cannot be true.
|
||||||
|
TODO: Check this, and then put the whole branch into the
|
||||||
|
"#ifdef THREAD" guard.
|
||||||
|
*/
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
/* Invalidate page in the block if it has not been done yet */
|
/* Invalidate page in the block if it has not been done yet */
|
||||||
if (block->status)
|
if (block->status)
|
||||||
@ -1401,6 +1451,7 @@ restart:
|
|||||||
KEYCACHE_DBUG_PRINT("find_key_block",
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
||||||
("request waiting for old page to be saved"));
|
("request waiting for old page to be saved"));
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
/* Put the request into the queue of those waiting for the old page */
|
/* Put the request into the queue of those waiting for the old page */
|
||||||
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
||||||
@ -1413,6 +1464,10 @@ restart:
|
|||||||
&keycache->cache_lock);
|
&keycache->cache_lock);
|
||||||
}
|
}
|
||||||
while(thread->next);
|
while(thread->next);
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(0);
|
||||||
|
/* No parallel requests in single-threaded case */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
KEYCACHE_DBUG_PRINT("find_key_block",
|
KEYCACHE_DBUG_PRINT("find_key_block",
|
||||||
("request for old page resubmitted"));
|
("request for old page resubmitted"));
|
||||||
@ -1471,6 +1526,7 @@ restart:
|
|||||||
all of them must get the same block
|
all of them must get the same block
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef THREAD
|
||||||
if (! keycache->used_last)
|
if (! keycache->used_last)
|
||||||
{
|
{
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
@ -1486,6 +1542,9 @@ restart:
|
|||||||
while (thread->next);
|
while (thread->next);
|
||||||
thread->opt_info= NULL;
|
thread->opt_info= NULL;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(keycache->used_last);
|
||||||
|
#endif
|
||||||
block= hash_link->block;
|
block= hash_link->block;
|
||||||
if (! block)
|
if (! block)
|
||||||
{
|
{
|
||||||
@ -1674,6 +1733,7 @@ static void read_block(KEY_CACHE *keycache,
|
|||||||
KEYCACHE_DBUG_PRINT("read_block",
|
KEYCACHE_DBUG_PRINT("read_block",
|
||||||
("secondary request waiting for new page to be read"));
|
("secondary request waiting for new page to be read"));
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
/* Put the request into a queue and wait until it can be processed */
|
/* Put the request into a queue and wait until it can be processed */
|
||||||
add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread);
|
add_to_queue(&block->wqueue[COND_FOR_REQUESTED], thread);
|
||||||
@ -1685,6 +1745,10 @@ static void read_block(KEY_CACHE *keycache,
|
|||||||
&keycache->cache_lock);
|
&keycache->cache_lock);
|
||||||
}
|
}
|
||||||
while (thread->next);
|
while (thread->next);
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(0);
|
||||||
|
/* No parallel requests in single-threaded case */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
KEYCACHE_DBUG_PRINT("read_block",
|
KEYCACHE_DBUG_PRINT("read_block",
|
||||||
("secondary request: new page in cache"));
|
("secondary request: new page in cache"));
|
||||||
@ -1822,7 +1886,7 @@ byte *key_cache_read(KEY_CACHE *keycache,
|
|||||||
#ifndef THREAD
|
#ifndef THREAD
|
||||||
/* This is only true if we where able to read everything in one block */
|
/* This is only true if we where able to read everything in one block */
|
||||||
if (return_buffer)
|
if (return_buffer)
|
||||||
return (block->buffer);
|
DBUG_RETURN(block->buffer);
|
||||||
#endif
|
#endif
|
||||||
buff+= read_length;
|
buff+= read_length;
|
||||||
filepos+= read_length+offset;
|
filepos+= read_length+offset;
|
||||||
@ -2398,6 +2462,7 @@ restart:
|
|||||||
#endif
|
#endif
|
||||||
block= first_in_switch;
|
block= first_in_switch;
|
||||||
{
|
{
|
||||||
|
#ifdef THREAD
|
||||||
struct st_my_thread_var *thread= my_thread_var;
|
struct st_my_thread_var *thread= my_thread_var;
|
||||||
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
add_to_queue(&block->wqueue[COND_FOR_SAVED], thread);
|
||||||
do
|
do
|
||||||
@ -2408,6 +2473,10 @@ restart:
|
|||||||
&keycache->cache_lock);
|
&keycache->cache_lock);
|
||||||
}
|
}
|
||||||
while (thread->next);
|
while (thread->next);
|
||||||
|
#else
|
||||||
|
KEYCACHE_DBUG_ASSERT(0);
|
||||||
|
/* No parallel requests in single-threaded case */
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#if defined(KEYCACHE_DEBUG)
|
#if defined(KEYCACHE_DEBUG)
|
||||||
cnt++;
|
cnt++;
|
||||||
@ -2574,7 +2643,6 @@ static void test_key_cache(KEY_CACHE *keycache __attribute__((unused)),
|
|||||||
static void keycache_dump(KEY_CACHE *keycache)
|
static void keycache_dump(KEY_CACHE *keycache)
|
||||||
{
|
{
|
||||||
FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w");
|
FILE *keycache_dump_file=fopen(KEYCACHE_DUMP_FILE, "w");
|
||||||
struct st_my_thread_var *thread_var= my_thread_var;
|
|
||||||
struct st_my_thread_var *last;
|
struct st_my_thread_var *last;
|
||||||
struct st_my_thread_var *thread;
|
struct st_my_thread_var *thread;
|
||||||
BLOCK_LINK *block;
|
BLOCK_LINK *block;
|
||||||
|
@ -123,7 +123,7 @@ then
|
|||||||
c_u="$c_u CREATE TABLE user ("
|
c_u="$c_u CREATE TABLE user ("
|
||||||
c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL,"
|
c_u="$c_u Host char(60) binary DEFAULT '' NOT NULL,"
|
||||||
c_u="$c_u User char(16) binary DEFAULT '' NOT NULL,"
|
c_u="$c_u User char(16) binary DEFAULT '' NOT NULL,"
|
||||||
c_u="$c_u Password char(41) binary DEFAULT '' NOT NULL,"
|
c_u="$c_u Password binary(41) DEFAULT '' NOT NULL,"
|
||||||
c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
c_u="$c_u Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||||
c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
c_u="$c_u Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||||
c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
c_u="$c_u Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,"
|
||||||
|
@ -156,9 +156,9 @@ alter table columns_priv comment='Column privileges';
|
|||||||
ALTER TABLE user
|
ALTER TABLE user
|
||||||
MODIFY Host char(60) NOT NULL default '',
|
MODIFY Host char(60) NOT NULL default '',
|
||||||
MODIFY User char(16) NOT NULL default '',
|
MODIFY User char(16) NOT NULL default '',
|
||||||
MODIFY Password char(41) NOT NULL default '',
|
|
||||||
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
ENGINE=MyISAM, CONVERT TO CHARACTER SET utf8 COLLATE utf8_bin;
|
||||||
ALTER TABLE user
|
ALTER TABLE user
|
||||||
|
MODIFY Password binary(41) NOT NULL default '',
|
||||||
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
MODIFY Select_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||||
MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
MODIFY Insert_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||||
MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
MODIFY Update_priv enum('N','Y') COLLATE utf8_general_ci DEFAULT 'N' NOT NULL,
|
||||||
|
@ -1703,6 +1703,6 @@ int ha_myisam::ft_read(byte * buf)
|
|||||||
|
|
||||||
uint ha_myisam::checksum() const
|
uint ha_myisam::checksum() const
|
||||||
{
|
{
|
||||||
return (uint)file->s->state.checksum;
|
return (uint)file->state->checksum;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1209,7 +1209,8 @@ inline ulong ha_ndbcluster::index_flags(uint idx_no, uint part,
|
|||||||
DBUG_ENTER("ha_ndbcluster::index_flags");
|
DBUG_ENTER("ha_ndbcluster::index_flags");
|
||||||
DBUG_PRINT("info", ("idx_no: %d", idx_no));
|
DBUG_PRINT("info", ("idx_no: %d", idx_no));
|
||||||
DBUG_ASSERT(get_index_type_from_table(idx_no) < index_flags_size);
|
DBUG_ASSERT(get_index_type_from_table(idx_no) < index_flags_size);
|
||||||
DBUG_RETURN(index_type_flags[get_index_type_from_table(idx_no)]);
|
DBUG_RETURN(index_type_flags[get_index_type_from_table(idx_no)] |
|
||||||
|
HA_KEY_SCAN_NOT_ROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void shrink_varchar(Field* field, const byte* & ptr, char* buf)
|
static void shrink_varchar(Field* field, const byte* & ptr, char* buf)
|
||||||
|
@ -98,6 +98,13 @@
|
|||||||
#define HA_ONLY_WHOLE_INDEX 16 /* Can't use part key searches */
|
#define HA_ONLY_WHOLE_INDEX 16 /* Can't use part key searches */
|
||||||
#define HA_KEYREAD_ONLY 64 /* Support HA_EXTRA_KEYREAD */
|
#define HA_KEYREAD_ONLY 64 /* Support HA_EXTRA_KEYREAD */
|
||||||
|
|
||||||
|
/*
|
||||||
|
Index scan will not return records in rowid order. Not guaranteed to be
|
||||||
|
set for unordered (e.g. HASH) indexes.
|
||||||
|
*/
|
||||||
|
#define HA_KEY_SCAN_NOT_ROR 128
|
||||||
|
|
||||||
|
|
||||||
/* operations for disable/enable indexes */
|
/* operations for disable/enable indexes */
|
||||||
#define HA_KEY_SWITCH_NONUNIQ 0
|
#define HA_KEY_SWITCH_NONUNIQ 0
|
||||||
#define HA_KEY_SWITCH_ALL 1
|
#define HA_KEY_SWITCH_ALL 1
|
||||||
|
@ -5117,6 +5117,8 @@ check_quick_select(PARAM *param,uint idx,SEL_ARG *tree)
|
|||||||
if (cpk_scan)
|
if (cpk_scan)
|
||||||
param->is_ror_scan= TRUE;
|
param->is_ror_scan= TRUE;
|
||||||
}
|
}
|
||||||
|
if (param->table->file->index_flags(key, 0, TRUE) & HA_KEY_SCAN_NOT_ROR)
|
||||||
|
param->is_ror_scan= FALSE;
|
||||||
DBUG_PRINT("exit", ("Records: %lu", (ulong) records));
|
DBUG_PRINT("exit", ("Records: %lu", (ulong) records));
|
||||||
DBUG_RETURN(records);
|
DBUG_RETURN(records);
|
||||||
}
|
}
|
||||||
|
@ -5366,12 +5366,12 @@ ER_TOO_BIG_SCALE 42000 S1009
|
|||||||
eng "Too big scale %d specified for column '%-.64s'. Maximum is %d."
|
eng "Too big scale %d specified for column '%-.64s'. Maximum is %d."
|
||||||
ER_TOO_BIG_PRECISION 42000 S1009
|
ER_TOO_BIG_PRECISION 42000 S1009
|
||||||
eng "Too big precision %d specified for column '%-.64s'. Maximum is %d."
|
eng "Too big precision %d specified for column '%-.64s'. Maximum is %d."
|
||||||
ER_SCALE_BIGGER_THAN_PRECISION 42000 S1009
|
ER_M_BIGGER_THAN_D 42000 S1009
|
||||||
eng "Scale may not be larger than the precision (column '%-.64s')."
|
eng "For float(M,D), double(M,D) or decimal(M,D), M must be >= D (column '%-.64s')."
|
||||||
ER_WRONG_LOCK_OF_SYSTEM_TABLE
|
ER_WRONG_LOCK_OF_SYSTEM_TABLE
|
||||||
eng "You can't combine write-locking of system '%-.64s.%-.64s' table with other tables"
|
eng "You can't combine write-locking of system '%-.64s.%-.64s' table with other tables"
|
||||||
ER_CONNECT_TO_FOREIGN_DATA_SOURCE
|
ER_CONNECT_TO_FOREIGN_DATA_SOURCE
|
||||||
eng "Unable to connect to foreign data source - database '%s'!"
|
eng "Unable to connect to foreign data source - database '%.64s'!"
|
||||||
ER_QUERY_ON_FOREIGN_DATA_SOURCE
|
ER_QUERY_ON_FOREIGN_DATA_SOURCE
|
||||||
eng "There was a problem processing the query on the foreign data source. Data source error: '%-.64s'"
|
eng "There was a problem processing the query on the foreign data source. Data source error: '%-.64s'"
|
||||||
ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
|
ER_FOREIGN_DATA_SOURCE_DOESNT_EXIST
|
||||||
@ -5400,7 +5400,7 @@ ER_DATETIME_FUNCTION_OVERFLOW 22008
|
|||||||
ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
|
||||||
eng "Can't update table '%-.64s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger."
|
eng "Can't update table '%-.64s' in stored function/trigger because it is already used by statement which invoked this stored function/trigger."
|
||||||
ER_VIEW_PREVENT_UPDATE
|
ER_VIEW_PREVENT_UPDATE
|
||||||
eng "The definition of table '%-.64s' prevents operation %s on table '%-.64s'."
|
eng "The definition of table '%-.64s' prevents operation %.64s on table '%-.64s'."
|
||||||
ER_PS_NO_RECURSION
|
ER_PS_NO_RECURSION
|
||||||
eng "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner"
|
eng "The prepared statement contains a stored routine call that refers to that same statement. It's not allowed to execute a prepared statement in such a recursive manner"
|
||||||
ER_SP_CANT_SET_AUTOCOMMIT
|
ER_SP_CANT_SET_AUTOCOMMIT
|
||||||
@ -5419,5 +5419,3 @@ ER_ROW_IS_REFERENCED_2 23000
|
|||||||
eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)"
|
eng "Cannot delete or update a parent row: a foreign key constraint fails (%.192s)"
|
||||||
ER_NO_REFERENCED_ROW_2 23000
|
ER_NO_REFERENCED_ROW_2 23000
|
||||||
eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
|
eng "Cannot add or update a child row: a foreign key constraint fails (%.192s)"
|
||||||
ER_M_BIGGER_THAN_D 42000 S1009
|
|
||||||
eng "For float(M,D) or double(M,D), M must be >= D (column '%-.64s')."
|
|
||||||
|
@ -5750,7 +5750,7 @@ new_create_field(THD *thd, char *field_name, enum_field_types type,
|
|||||||
}
|
}
|
||||||
if (new_field->length < new_field->decimals)
|
if (new_field->length < new_field->decimals)
|
||||||
{
|
{
|
||||||
my_error(ER_SCALE_BIGGER_THAN_PRECISION, MYF(0), field_name);
|
my_error(ER_M_BIGGER_THAN_D, MYF(0), field_name);
|
||||||
DBUG_RETURN(NULL);
|
DBUG_RETURN(NULL);
|
||||||
}
|
}
|
||||||
new_field->length=
|
new_field->length=
|
||||||
|
@ -4074,7 +4074,7 @@ bool mysql_checksum_table(THD *thd, TABLE_LIST *tables, HA_CHECK_OPT *check_opt)
|
|||||||
|
|
||||||
strxmov(table_name, table->db ,".", table->table_name, NullS);
|
strxmov(table_name, table->db ,".", table->table_name, NullS);
|
||||||
|
|
||||||
t= table->table= open_ltable(thd, table, TL_READ_NO_INSERT);
|
t= table->table= open_ltable(thd, table, TL_READ);
|
||||||
thd->clear_error(); // these errors shouldn't get client
|
thd->clear_error(); // these errors shouldn't get client
|
||||||
|
|
||||||
protocol->prepare_for_resend();
|
protocol->prepare_for_resend();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user