Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0-release

into mysql.com:/Users/kent/mysql/bk/mysql-5.0


mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
This commit is contained in:
unknown 2005-09-30 22:37:55 +02:00
commit 1d3497702a
53 changed files with 136 additions and 42 deletions

View File

@ -48,7 +48,7 @@ AM_MAKEFLAGS="-j 4"
# The following warning flag will give too many warnings: # The following warning flag will give too many warnings:
# -Wshadow -Wunused -Winline (The later isn't usable in C++ as # -Wshadow -Wunused -Winline (The later isn't usable in C++ as
# __attribute()__ doesn't work with gnu C++) # __attribute()__ doesn't work with gnu C++)
global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings" global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -ansi"
#debug_extra_warnings="-Wuninitialized" #debug_extra_warnings="-Wuninitialized"
c_warnings="$global_warnings -Wunused" c_warnings="$global_warnings -Wunused"
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"

0
VC++Files/bdb/bdb.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysql.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysqladmin.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysqlclient.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysqldump.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysqlimport.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysqlshow.vcproj Executable file → Normal file
View File

0
VC++Files/client/mysqltest.vcproj Executable file → Normal file
View File

0
VC++Files/comp_err/comp_err.vcproj Executable file → Normal file
View File

0
VC++Files/dbug/dbug.vcproj Executable file → Normal file
View File

0
VC++Files/heap/heap.vcproj Executable file → Normal file
View File

0
VC++Files/innobase/innobase.vcproj Executable file → Normal file
View File

0
VC++Files/libmysql/libmysql.vcproj Executable file → Normal file
View File

0
VC++Files/libmysqld/examples/test_libmysqld.vcproj Executable file → Normal file
View File

0
VC++Files/libmysqld/libmysqld.vcproj Executable file → Normal file
View File

0
VC++Files/libmysqltest/myTest.vcproj Executable file → Normal file
View File

0
VC++Files/my_print_defaults/my_print_defaults.vcproj Executable file → Normal file
View File

0
VC++Files/myisam/myisam.vcproj Executable file → Normal file
View File

0
VC++Files/myisam_ftdump/myisam_ftdump.vcproj Executable file → Normal file
View File

0
VC++Files/myisamchk/myisamchk.vcproj Executable file → Normal file
View File

0
VC++Files/myisamlog/myisamlog.vcproj Executable file → Normal file
View File

0
VC++Files/myisammrg/myisammrg.vcproj Executable file → Normal file
View File

0
VC++Files/myisampack/myisampack.vcproj Executable file → Normal file
View File

0
VC++Files/mysql-test/mysql_test_run_new.vcproj Executable file → Normal file
View File

0
VC++Files/mysql.sln Executable file → Normal file
View File

0
VC++Files/mysqlbinlog/mysqlbinlog.vcproj Executable file → Normal file
View File

0
VC++Files/mysqlcheck/mysqlcheck.vcproj Executable file → Normal file
View File

0
VC++Files/mysqldemb/mysqldemb.vcproj Executable file → Normal file
View File

0
VC++Files/mysqlserver/dummy.cpp Executable file → Normal file
View File

0
VC++Files/mysqlserver/mysqlserver.vcproj Executable file → Normal file
View File

43
VC++Files/mysys/mysys.vcproj Executable file → Normal file
View File

@ -2200,6 +2200,49 @@
PreprocessorDefinitions=""/> PreprocessorDefinitions=""/>
</FileConfiguration> </FileConfiguration>
</File> </File>
<File
RelativePath="my_conio.c">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Max|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="TLS_DEBUG|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
<FileConfiguration
Name="TLS|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File <File
RelativePath="my_copy.c"> RelativePath="my_copy.c">
<FileConfiguration <FileConfiguration

0
VC++Files/perror/perror.vcproj Executable file → Normal file
View File

0
VC++Files/regex/regex.vcproj Executable file → Normal file
View File

0
VC++Files/replace/replace.vcproj Executable file → Normal file
View File

0
VC++Files/sql/mysqld.vcproj Executable file → Normal file
View File

0
VC++Files/strings/strings.vcproj Executable file → Normal file
View File

0
VC++Files/test1/test1.vcproj Executable file → Normal file
View File

0
VC++Files/tests/mysql_client_test.vcproj Executable file → Normal file
View File

0
VC++Files/thr_test/thr_test.vcproj Executable file → Normal file
View File

0
VC++Files/vio/vio.vcproj Executable file → Normal file
View File

0
VC++Files/zlib/zlib.vcproj Executable file → Normal file
View File

View File

@ -1014,7 +1014,7 @@ static int read_and_execute(bool interactive)
unsigned long clen; unsigned long clen;
do do
{ {
line= my_cgets(tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen); line= my_cgets((char*)tmpbuf.ptr(), tmpbuf.alloced_length()-1, &clen);
buffer.append(line, clen); buffer.append(line, clen);
/* /*
if we got buffer fully filled than there is a chance that if we got buffer fully filled than there is a chance that

View File

@ -2616,31 +2616,50 @@ SET FOREIGN_KEY_CHECKS=1;
INSERT INTO t2 VALUES(3); INSERT INTO t2 VALUES(3);
ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`)) ERROR 23000: Cannot add or update a child row: a foreign key constraint fails (`test/t2`, CONSTRAINT `c1` FOREIGN KEY (`v`) REFERENCES `t1` (`id`))
DROP TABLE t2; DROP TABLE t2;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2); insert into t1 values (1),(2);
set autocommit=0; set autocommit=0;
checksum table test_checksum; checksum table t1;
Table Checksum Table Checksum
test.test_checksum 1531596814 test.t1 1531596814
insert into test_checksum values(3); insert into t1 values(3);
checksum table test_checksum; checksum table t1;
Table Checksum Table Checksum
test.test_checksum 2605035534 test.t1 2605035534
commit; commit;
checksum table test_checksum; checksum table t1;
Table Checksum Table Checksum
test.test_checksum 127268899 test.t1 127268899
commit; commit;
drop table test_checksum; drop table t1;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2); insert into t1 values (1),(2);
set autocommit=1; set autocommit=1;
checksum table test_checksum; checksum table t1;
Table Checksum Table Checksum
test.test_checksum 1531596814 test.t1 1531596814
set autocommit=1; set autocommit=1;
insert into test_checksum values(3); insert into t1 values(3);
checksum table test_checksum; checksum table t1;
Table Checksum Table Checksum
test.test_checksum 127268899 test.t1 127268899
drop table test_checksum; drop table t1;
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100);
create function f1 () returns integer begin
declare var1 int;
select col2 into var1 from t1 where col1=1 for update;
return var1;
end|
start transaction;
select f1();
f1()
100
update t1 set col2=0 where col1=1;
select * from t1;
col1 col2
1 100
rollback;
rollback;
drop table t1;
drop function f1;

View File

@ -1571,36 +1571,67 @@ DROP TABLE t2;
connect (a,localhost,root,,); connect (a,localhost,root,,);
connect (b,localhost,root,,); connect (b,localhost,root,,);
connection a; connection a;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2); insert into t1 values (1),(2);
set autocommit=0; set autocommit=0;
checksum table test_checksum; checksum table t1;
connection b; connection b;
insert into test_checksum values(3); insert into t1 values(3);
connection a; connection a;
# #
# Here checksum should not see insert # Here checksum should not see insert
# #
checksum table test_checksum; checksum table t1;
connection a; connection a;
commit; commit;
checksum table test_checksum; checksum table t1;
commit; commit;
drop table test_checksum; drop table t1;
# #
# autocommit = 1 # autocommit = 1
# #
connection a; connection a;
create table test_checksum(a int not null) engine=innodb DEFAULT CHARSET=latin1; create table t1(a int not null) engine=innodb DEFAULT CHARSET=latin1;
insert into test_checksum values (1),(2); insert into t1 values (1),(2);
set autocommit=1; set autocommit=1;
checksum table test_checksum; checksum table t1;
connection b; connection b;
set autocommit=1; set autocommit=1;
insert into test_checksum values(3); insert into t1 values(3);
connection a; connection a;
# #
# Here checksum sees insert # Here checksum sees insert
# #
checksum table test_checksum; checksum table t1;
drop table test_checksum; drop table t1;
#
# BUG#11238 - in prelocking mode SELECT .. FOR UPDATE is changed to
# non-blocking SELECT
#
create table t1 (col1 integer primary key, col2 integer) engine=innodb;
insert t1 values (1,100);
delimiter |;
create function f1 () returns integer begin
declare var1 int;
select col2 into var1 from t1 where col1=1 for update;
return var1;
end|
delimiter ;|
start transaction;
select f1();
connection b;
send update t1 set col2=0 where col1=1;
connection default;
select * from t1;
connection a;
rollback;
connection b;
reap;
rollback;
connection default;
drop table t1;
drop function f1;
disconnect a;
disconnect b;

View File

@ -1894,7 +1894,7 @@ int ha_berkeley::external_lock(THD *thd, int lock_type)
Under LOCK TABLES, each used tables will force a call to start_stmt. Under LOCK TABLES, each used tables will force a call to start_stmt.
*/ */
int ha_berkeley::start_stmt(THD *thd) int ha_berkeley::start_stmt(THD *thd, thr_lock_type lock_type)
{ {
int error=0; int error=0;
DBUG_ENTER("ha_berkeley::start_stmt"); DBUG_ENTER("ha_berkeley::start_stmt");

View File

@ -124,7 +124,7 @@ class ha_berkeley: public handler
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation);
int reset(void); int reset(void);
int external_lock(THD *thd, int lock_type); int external_lock(THD *thd, int lock_type);
int start_stmt(THD *thd); int start_stmt(THD *thd, thr_lock_type lock_type);
void position(byte *record); void position(byte *record);
int analyze(THD* thd,HA_CHECK_OPT* check_opt); int analyze(THD* thd,HA_CHECK_OPT* check_opt);
int optimize(THD* thd, HA_CHECK_OPT* check_opt); int optimize(THD* thd, HA_CHECK_OPT* check_opt);

View File

@ -6000,7 +6000,8 @@ int
ha_innobase::start_stmt( ha_innobase::start_stmt(
/*====================*/ /*====================*/
/* out: 0 or error code */ /* out: 0 or error code */
THD* thd) /* in: handle to the user thread */ THD* thd, /* in: handle to the user thread */
thr_lock_type lock_type)
{ {
row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt; row_prebuilt_t* prebuilt = (row_prebuilt_t*) innobase_prebuilt;
trx_t* trx; trx_t* trx;
@ -6041,7 +6042,7 @@ ha_innobase::start_stmt(
} else { } else {
if (trx->isolation_level != TRX_ISO_SERIALIZABLE if (trx->isolation_level != TRX_ISO_SERIALIZABLE
&& thd->lex->sql_command == SQLCOM_SELECT && thd->lex->sql_command == SQLCOM_SELECT
&& thd->lex->lock_option == TL_READ) { && lock_type == TL_READ) {
/* For other than temporary tables, we obtain /* For other than temporary tables, we obtain
no lock for consistent read (plain SELECT). */ no lock for consistent read (plain SELECT). */

View File

@ -150,7 +150,7 @@ class ha_innobase: public handler
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation);
int external_lock(THD *thd, int lock_type); int external_lock(THD *thd, int lock_type);
int transactional_table_lock(THD *thd, int lock_type); int transactional_table_lock(THD *thd, int lock_type);
int start_stmt(THD *thd); int start_stmt(THD *thd, thr_lock_type lock_type);
void position(byte *record); void position(byte *record);
ha_rows records_in_range(uint inx, key_range *min_key, key_range ha_rows records_in_range(uint inx, key_range *min_key, key_range

View File

@ -3401,7 +3401,7 @@ int ha_ndbcluster::external_lock(THD *thd, int lock_type)
startTransaction for each transaction/statement. startTransaction for each transaction/statement.
*/ */
int ha_ndbcluster::start_stmt(THD *thd) int ha_ndbcluster::start_stmt(THD *thd, thr_lock_type lock_type)
{ {
int error=0; int error=0;
DBUG_ENTER("start_stmt"); DBUG_ENTER("start_stmt");

View File

@ -501,7 +501,7 @@ class ha_ndbcluster: public handler
int extra(enum ha_extra_function operation); int extra(enum ha_extra_function operation);
int extra_opt(enum ha_extra_function operation, ulong cache_size); int extra_opt(enum ha_extra_function operation, ulong cache_size);
int external_lock(THD *thd, int lock_type); int external_lock(THD *thd, int lock_type);
int start_stmt(THD *thd); int start_stmt(THD *thd, thr_lock_type lock_type);
const char * table_type() const; const char * table_type() const;
const char ** bas_ext() const; const char ** bas_ext() const;
ulong table_flags(void) const; ulong table_flags(void) const;

View File

@ -654,7 +654,7 @@ public:
virtual int reset() { return extra(HA_EXTRA_RESET); } virtual int reset() { return extra(HA_EXTRA_RESET); }
virtual int external_lock(THD *thd, int lock_type) { return 0; } virtual int external_lock(THD *thd, int lock_type) { return 0; }
virtual void unlock_row() {} virtual void unlock_row() {}
virtual int start_stmt(THD *thd) {return 0;} virtual int start_stmt(THD *thd, thr_lock_type lock_type) {return 0;}
/* /*
This is called to delete all rows in a table This is called to delete all rows in a table
If the handler don't support this, then this function will If the handler don't support this, then this function will

View File

@ -2148,7 +2148,7 @@ static bool check_lock_and_start_stmt(THD *thd, TABLE *table,
my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0),table->alias); my_error(ER_TABLE_NOT_LOCKED_FOR_WRITE, MYF(0),table->alias);
DBUG_RETURN(1); DBUG_RETURN(1);
} }
if ((error=table->file->start_stmt(thd))) if ((error=table->file->start_stmt(thd, lock_type)))
{ {
table->file->print_error(error,MYF(0)); table->file->print_error(error,MYF(0));
DBUG_RETURN(1); DBUG_RETURN(1);