Below is the list of changes that have just been committed into a local
5.0 repository of msvensson. When msvensson does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1919 05/05/26 12:54:53 msvensson@neptunus.(none) +57 -0
Manual merge from 4.1 to 5.0
sql/sql_repl.cc
1.137 05/05/26 12:54:49 msvensson@neptunus.(none) +34 -0
Merge
sql/sql_parse.cc
1.435 05/05/26 12:54:48 msvensson@neptunus.(none) +24 -1
Merge
sql/opt_range.cc
1.163 05/05/26 12:54:48 msvensson@neptunus.(none) +0 -0
Merge
mysql-test/t/union.test
1.86 05/05/26 12:54:48 msvensson@neptunus.(none) +2 -2
Merge
mysql-test/t/select.test
1.47 05/05/26 12:54:48 msvensson@neptunus.(none) +0 -0
Merge
mysql-test/r/union.result
1.72 05/05/26 12:54:48 msvensson@neptunus.(none) +5 -5
Merge
client/client_priv.h
1.36 05/05/26 12:54:48 msvensson@neptunus.(none) +1 -2
Merge
sql/tztime.cc
1.21 05/05/26 12:44:51 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_yacc.yy
1.382 05/05/26 12:44:51 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_udf.cc
1.48 05/05/26 12:44:51 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_string.cc
1.86 05/05/26 12:44:51 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_select.cc
1.326 05/05/26 12:44:51 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_olap.cc
1.16 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_map.cc
1.11 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_lex.cc
1.145 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_class.cc
1.179 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_analyse.h
1.20 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/sql_analyse.cc
1.58 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/set_var.cc
1.113 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/protocol_cursor.cc
1.12 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/protocol.cc
1.103 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/procedure.cc
1.8 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/log_event.h
1.111 05/05/26 12:44:50 msvensson@neptunus.(none) +0 -0
Auto merged
sql/log_event.cc
1.176 05/05/26 12:44:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_uniq.h
1.24 05/05/26 12:44:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_uniq.cc
1.7 05/05/26 12:44:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_timefunc.cc
1.82 05/05/26 12:44:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_sum.cc
1.144 05/05/26 12:44:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_subselect.cc
1.100 05/05/26 12:44:49 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_strfunc.cc
1.227 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_geofunc.cc
1.22 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_func.cc
1.200 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item_cmpfunc.cc
1.146 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/item.cc
1.124 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/handler.cc
1.170 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_ndbcluster.cc
1.179 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_myisammrg.cc
1.64 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_myisam.cc
1.149 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_innodb.cc
1.211 05/05/26 12:44:48 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_heap.cc
1.65 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_blackhole.cc
1.8 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
sql/ha_berkeley.cc
1.147 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
sql/field.cc
1.261 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
ndb/src/kernel/blocks/dbtux/Dbtux.hpp
1.40 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
mysys/raid.cc
1.33 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
mysys/my_open.c
1.21 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
mysql-test/t/mysqldump.test
1.38 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
mysql-test/r/select.result
1.62 05/05/26 12:44:47 msvensson@neptunus.(none) +1 -1
Auto merged
mysql-test/r/mysqldump.result
1.44 05/05/26 12:44:47 msvensson@neptunus.(none) +38 -38
Auto merged
mysql-test/mysql-test-run.sh
1.267 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
include/my_sys.h
1.157 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
include/my_global.h
1.89 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
client/sql_string.h
1.13 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
client/sql_string.cc
1.22 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
client/mysqldump.c
1.181 05/05/26 12:44:47 msvensson@neptunus.(none) +0 -0
Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e
1.22 05/05/26 12:44:46 msvensson@neptunus.(none) +0 -0
Auto merged
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e
1.37 05/05/26 12:44:46 msvensson@neptunus.(none) +0 -0
Auto merged
BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e
1.15.1.3 05/05/26 12:44:46 msvensson@neptunus.(none) +0 -0
Merge rename: sql/ha_isammrg.cc -> BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e
BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e
1.29.1.3 05/05/26 12:44:46 msvensson@neptunus.(none) +0 -0
Merge rename: sql/ha_isam.cc -> BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: msvensson
# Host: neptunus.(none)
# Root: /home/msvensson/mysql/mysql-5.0/RESYNC
--- 1.180/client/mysqldump.c 2005-05-19 00:40:31 +02:00
+++ 1.181/client/mysqldump.c 2005-05-26 12:44:47 +02:00
@@ -85,7 +85,7 @@
opt_delete_master_logs=0, tty_password=0,
opt_single_transaction=0, opt_comments= 0, opt_compact= 0,
opt_hex_blob=0, opt_order_by_primary=0, opt_ignore=0,
- opt_complete_insert= 0;
+ opt_complete_insert= 0, opt_drop_database= 0;
static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*sock=0;
static my_bool insert_pat_inited=0;
@@ -161,6 +161,9 @@
"Dump all the databases. This will be same as --databases with all databases selected.",
(gptr*) &opt_alldbs, (gptr*) &opt_alldbs, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0,
0, 0},
+ {"add-drop-database", OPT_DROP_DATABASE, "Add a 'DROP DATABASE' before each create.",
+ (gptr*) &opt_drop_database, (gptr*) &opt_drop_database, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0,
+ 0},
{"add-drop-table", OPT_DROP, "Add a 'drop table' before each create.",
(gptr*) &opt_drop, (gptr*) &opt_drop, 0, GET_BOOL, NO_ARG, 1, 0, 0, 0, 0,
0},
@@ -1144,9 +1147,9 @@
else
dynstr_set(&insert_pat, "");
- insert_option= (opt_delayed && opt_ignore) ? " DELAYED IGNORE " :
- opt_delayed ? " DELAYED " :
- opt_ignore ? " IGNORE " : "";
+ insert_option= ((opt_delayed && opt_ignore) ? " DELAYED IGNORE " :
+ opt_delayed ? " DELAYED " :
+ opt_ignore ? " IGNORE " : "");
if (verbose)
fprintf(stderr, "-- Retrieving table structure for table %s...\n", table);
@@ -2116,12 +2119,20 @@
if (mysql_query(sock, qbuf) || !(dbinfo = mysql_store_result(sock)))
{
/* Old server version, dump generic CREATE DATABASE */
+ if (opt_drop_database)
+ fprintf(md_result_file,
+ "\n/*!40000 DROP DATABASE IF EXISTS %s;*/\n",
+ qdatabase);
fprintf(md_result_file,
"\nCREATE DATABASE /*!32312 IF NOT EXISTS*/ %s;\n",
qdatabase);
}
else
{
+ if (opt_drop_database)
+ fprintf(md_result_file,
+ "\n/*!40000 DROP DATABASE IF EXISTS %s*/;\n",
+ qdatabase);
row = mysql_fetch_row(dbinfo);
if (row[1])
{
--- 1.21/client/sql_string.cc 2005-03-16 15:10:54 +01:00
+++ 1.22/client/sql_string.cc 2005-05-26 12:44:47 +02:00
@@ -16,7 +16,7 @@
/* This file is originally from the mysql distribution. Coded by monty */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.12/client/sql_string.h 2005-03-16 15:10:54 +01:00
+++ 1.13/client/sql_string.h 2005-05-26 12:44:47 +02:00
@@ -16,7 +16,7 @@
/* This file is originally from the mysql distribution. Coded by monty */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
--- 1.156/include/my_sys.h 2005-05-20 23:31:13 +02:00
+++ 1.157/include/my_sys.h 2005-05-26 12:44:47 +02:00
@@ -605,6 +605,7 @@
#else
#define my_access access
#endif
+extern int check_if_legal_filename(const char *path);
#ifndef TERMINATE
extern void TERMINATE(FILE *file);
--- 1.266/mysql-test/mysql-test-run.sh 2005-05-18 20:02:07 +02:00
+++ 1.267/mysql-test/mysql-test-run.sh 2005-05-26 12:44:47 +02:00
@@ -1212,8 +1212,8 @@
$NOT_FIRST_MASTER_EXTRA_OPTS"
fi
- CUR_MYERR=$MASTER_MYERR
- CUR_MYSOCK=$MASTER_MYSOCK
+ CUR_MYERR=$MASTER_MYERR$1
+ CUR_MYSOCK=$MASTER_MYSOCK$1
# For embedded server we collect the server flags and return
if [ "x$USE_EMBEDDED_SERVER" = "x1" ] ; then
--- 1.20/mysys/my_open.c 2005-05-24 00:31:26 +02:00
+++ 1.21/mysys/my_open.c 2005-05-26 12:44:47 +02:00
@@ -47,12 +47,15 @@
FileName, Flags, MyFlags));
#if defined(MSDOS) || defined(__WIN__) || defined(__EMX__) || defined(OS2)
/*
- if we are not creating, then we need to use my_access to make
- sure the file exists since Windows doesn't handle files like
- "com1.sym" very well
+ Check that we don't try to open or create a file name that may
+ cause problems for us in the future (like PRN)
*/
- if (! (Flags & O_CREAT) && my_access(FileName, F_OK))
- return -1;
+ if (check_if_legal_filename(FileName))
+ {
+ errno= EACCES;
+ DBUG_RETURN(my_register_filename(-1, FileName, FILE_BY_OPEN,
+ EE_FILENOTFOUND, MyFlags));
+ }
if (Flags & O_SHARE)
fd = sopen((my_string) FileName, (Flags & ~O_SHARE) | O_BINARY, SH_DENYNO,
MY_S_IREAD | MY_S_IWRITE);
--- 1.32/mysys/raid.cc 2004-12-18 04:19:15 +01:00
+++ 1.33/mysys/raid.cc 2005-05-26 12:44:47 +02:00
@@ -70,7 +70,7 @@
tonu@stripped & monty@stripped
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.260/sql/field.cc 2005-05-13 10:22:22 +02:00
+++ 1.261/sql/field.cc 2005-05-26 12:44:47 +02:00
@@ -19,7 +19,7 @@
** This file implements classes defined in field.h
*****************************************************************************/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.146/sql/ha_berkeley.cc 2005-05-06 10:39:14 +02:00
+++ 1.147/sql/ha_berkeley.cc 2005-05-26 12:44:47 +02:00
@@ -47,7 +47,7 @@
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.64/sql/ha_heap.cc 2005-05-07 13:59:49 +02:00
+++ 1.65/sql/ha_heap.cc 2005-05-26 12:44:47 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.29.1.2/sql/ha_isam.cc 2005-05-26 12:09:08 +02:00
+++ 1.37/BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e 2005-05-26 12:44:46 +02:00
@@ -69,7 +69,7 @@
int ha_isam::write_row(byte * buf)
{
- statistic_increment(ha_write_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_write_count, &LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_INSERT)
table->timestamp_field->set_time();
if (table->next_number_field && buf == table->record[0])
@@ -79,7 +79,7 @@
int ha_isam::update_row(const byte * old_data, byte * new_data)
{
- statistic_increment(ha_update_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_update_count, &LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
return !nisam_update(file,old_data,new_data) ? 0 : my_errno ? my_errno : -1;
@@ -87,14 +87,15 @@
int ha_isam::delete_row(const byte * buf)
{
- statistic_increment(ha_delete_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status);
return !nisam_delete(file,buf) ? 0 : my_errno ? my_errno : -1;
}
int ha_isam::index_read(byte * buf, const byte * key,
uint key_len, enum ha_rkey_function find_flag)
{
- statistic_increment(ha_read_key_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_key_count,
+ &LOCK_status);
int error=nisam_rkey(file, buf, active_index, key, key_len, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : -1;
@@ -103,7 +104,8 @@
int ha_isam::index_read_idx(byte * buf, uint index, const byte * key,
uint key_len, enum ha_rkey_function find_flag)
{
- statistic_increment(ha_read_key_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_key_count,
+ &LOCK_status);
int error=nisam_rkey(file, buf, index, key, key_len, find_flag);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : -1;
@@ -111,7 +113,8 @@
int ha_isam::index_read_last(byte * buf, const byte * key, uint key_len)
{
- statistic_increment(ha_read_key_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_key_count,
+ &LOCK_status);
int error=nisam_rkey(file, buf, active_index, key, key_len,
HA_READ_PREFIX_LAST);
table->status=error ? STATUS_NOT_FOUND: 0;
@@ -120,7 +123,8 @@
int ha_isam::index_next(byte * buf)
{
- statistic_increment(ha_read_next_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_next_count,
+ &LOCK_status);
int error=nisam_rnext(file,buf,active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -128,7 +132,8 @@
int ha_isam::index_prev(byte * buf)
{
- statistic_increment(ha_read_prev_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_prev_count,
+ &LOCK_status);
int error=nisam_rprev(file,buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -136,7 +141,8 @@
int ha_isam::index_first(byte * buf)
{
- statistic_increment(ha_read_first_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_first_count,
+ &LOCK_status);
int error=nisam_rfirst(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -144,7 +150,8 @@
int ha_isam::index_last(byte * buf)
{
- statistic_increment(ha_read_last_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_last_count,
+ &LOCK_status);
int error=nisam_rlast(file, buf, active_index);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : HA_ERR_END_OF_FILE;
@@ -157,7 +164,8 @@
int ha_isam::rnd_next(byte *buf)
{
- statistic_increment(ha_read_rnd_next_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
+ &LOCK_status);
int error=nisam_rrnd(file, buf, NI_POS_ERROR);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : -1;
@@ -165,8 +173,9 @@
int ha_isam::rnd_pos(byte * buf, byte *pos)
{
- statistic_increment(ha_read_rnd_count,&LOCK_status);
- int error=nisam_rrnd(file, buf, (ulong) ha_get_ptr(pos,ref_length));
+ statistic_increment(table->in_use->status_var.ha_read_rnd_count,
+ &LOCK_status);
+ int error=nisam_rrnd(file, buf, (ulong) my_get_ptr(pos,ref_length));
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : -1;
}
@@ -176,7 +185,7 @@
my_off_t position=nisam_position(file);
if (position == (my_off_t) ~ (ulong) 0)
position=HA_OFFSET_ERROR;
- ha_store_ptr(ref, ref_length, position);
+ my_store_ptr(ref, ref_length, position);
}
void ha_isam::info(uint flag)
@@ -221,7 +230,7 @@
if (flag & HA_STATUS_ERRKEY)
{
errkey = info.errkey;
- ha_store_ptr(dupp_ref, ref_length, info.dupp_key_pos);
+ my_store_ptr(dupp_ref, ref_length, info.dupp_key_pos);
}
if (flag & HA_STATUS_TIME)
update_time = info.update_time;
@@ -330,7 +339,7 @@
}
}
}
- DBUG_PRINT("loop",("found: %lx recpos: %d minpos: %d length: %d",
+ DBUG_PRINT("loop",("found: 0x%lx recpos: %d minpos: %d length: %d",
found,recpos,minpos,length));
if (recpos != minpos)
{ // Reserved space (Null bits?)
--- 1.15.1.2/sql/ha_isammrg.cc 2005-05-26 12:09:08 +02:00
+++ 1.22/BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e 2005-05-26 12:44:46 +02:00
@@ -77,7 +77,7 @@
int ha_isammrg::update_row(const byte * old_data, byte * new_data)
{
- statistic_increment(ha_update_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_update_count, &LOCK_status);
if (table->timestamp_field_type & TIMESTAMP_AUTO_SET_ON_UPDATE)
table->timestamp_field->set_time();
return !mrg_update(file,old_data,new_data) ? 0 : my_errno ? my_errno : -1;
@@ -85,7 +85,7 @@
int ha_isammrg::delete_row(const byte * buf)
{
- statistic_increment(ha_delete_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_delete_count, &LOCK_status);
return !mrg_delete(file,buf) ? 0 : my_errno ? my_errno : -1;
}
@@ -128,7 +128,8 @@
int ha_isammrg::rnd_next(byte *buf)
{
- statistic_increment(ha_read_rnd_next_count,&LOCK_status);
+ statistic_increment(table->in_use->status_var.ha_read_rnd_next_count,
+ &LOCK_status);
int error=mrg_rrnd(file, buf, ~(mrg_off_t) 0);
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : -1;
@@ -136,8 +137,9 @@
int ha_isammrg::rnd_pos(byte * buf, byte *pos)
{
- statistic_increment(ha_read_rnd_count,&LOCK_status);
- int error=mrg_rrnd(file, buf, (ulong) ha_get_ptr(pos,ref_length));
+ statistic_increment(table->in_use->status_var.ha_read_rnd_count,
+ &LOCK_status);
+ int error=mrg_rrnd(file, buf, (ulong) my_get_ptr(pos,ref_length));
table->status=error ? STATUS_NOT_FOUND: 0;
return !error ? 0 : my_errno ? my_errno : -1;
}
@@ -145,7 +147,7 @@
void ha_isammrg::position(const byte *record)
{
ulong position= mrg_position(file);
- ha_store_ptr(ref, ref_length, (my_off_t) position);
+ my_store_ptr(ref, ref_length, (my_off_t) position);
}
--- 1.148/sql/ha_myisam.cc 2005-04-27 11:25:04 +02:00
+++ 1.149/sql/ha_myisam.cc 2005-05-26 12:44:48 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.63/sql/ha_myisammrg.cc 2005-05-23 19:55:24 +02:00
+++ 1.64/sql/ha_myisammrg.cc 2005-05-26 12:44:48 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.169/sql/handler.cc 2005-05-18 09:41:30 +02:00
+++ 1.170/sql/handler.cc 2005-05-26 12:44:48 +02:00
@@ -17,7 +17,7 @@
/* Handler-calling-functions */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.123/sql/item.cc 2005-05-25 23:18:20 +02:00
+++ 1.124/sql/item.cc 2005-05-26 12:44:48 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
@@ -3700,6 +3700,7 @@
*ptr=0; // Keep purify happy
collation.set(&my_charset_bin, DERIVATION_COERCIBLE);
fixed= 1;
+ unsigned_flag= 1;
}
longlong Item_hex_string::val_int()
--- 1.145/sql/item_cmpfunc.cc 2005-05-06 12:46:01 +02:00
+++ 1.146/sql/item_cmpfunc.cc 2005-05-26 12:44:48 +02:00
@@ -17,7 +17,7 @@
/* This file defines all compare functions */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.199/sql/item_func.cc 2005-05-19 22:23:58 +02:00
+++ 1.200/sql/item_func.cc 2005-05-26 12:44:48 +02:00
@@ -17,7 +17,7 @@
/* This file defines all numerical functions */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.226/sql/item_strfunc.cc 2005-05-19 22:04:00 +02:00
+++ 1.227/sql/item_strfunc.cc 2005-05-26 12:44:48 +02:00
@@ -20,7 +20,7 @@
** (This shouldn't be needed)
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.143/sql/item_sum.cc 2005-05-20 15:14:30 +02:00
+++ 1.144/sql/item_sum.cc 2005-05-26 12:44:49 +02:00
@@ -17,7 +17,7 @@
/* Sum functions (COUNT, MIN...) */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.81/sql/item_timefunc.cc 2005-04-25 09:35:20 +02:00
+++ 1.82/sql/item_timefunc.cc 2005-05-26 12:44:49 +02:00
@@ -17,7 +17,7 @@
/* This file defines all time functions */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.6/sql/item_uniq.cc 2005-02-08 23:49:34 +01:00
+++ 1.7/sql/item_uniq.cc 2005-05-26 12:44:49 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* Compability file */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation
#endif
--- 1.23/sql/item_uniq.h 2005-02-08 23:49:34 +01:00
+++ 1.24/sql/item_uniq.h 2005-05-26 12:44:49 +02:00
@@ -16,7 +16,7 @@
/* Compability file ; This file only contains dummy functions */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface
#endif
--- 1.175/sql/log_event.cc 2005-05-05 14:20:45 +02:00
+++ 1.176/sql/log_event.cc 2005-05-26 12:44:49 +02:00
@@ -16,7 +16,7 @@
#ifndef MYSQL_CLIENT
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
#include "mysql_priv.h"
--- 1.110/sql/log_event.h 2005-05-05 14:20:46 +02:00
+++ 1.111/sql/log_event.h 2005-05-26 12:44:50 +02:00
@@ -22,7 +22,7 @@
#undef write // remove pthread.h macro definition, conflict with write() class member
#endif
-#if defined(__GNUC__) && !defined(MYSQL_CLIENT)
+#if defined(USE_PRAGMA_INTERFACE) && !defined(MYSQL_CLIENT)
#pragma interface /* gcc class implementation */
#endif
--- 1.102/sql/protocol.cc 2005-05-01 17:07:00 +02:00
+++ 1.103/sql/protocol.cc 2005-05-26 12:44:50 +02:00
@@ -19,7 +19,7 @@
The actual communction is handled by the net_xxx functions in net_serv.cc
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.162/sql/opt_range.cc 2005-05-25 17:33:25 +02:00
+++ 1.163/sql/opt_range.cc 2005-05-26 12:54:48 +02:00
@@ -36,7 +36,7 @@
QUICK_RANGEs are also created in this step.
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.7/sql/procedure.cc 2005-02-08 23:49:34 +01:00
+++ 1.8/sql/procedure.cc 2005-05-26 12:44:50 +02:00
@@ -17,7 +17,7 @@
/* Procedures (functions with changes output of select) */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.57/sql/sql_analyse.cc 2005-02-25 15:53:16 +01:00
+++ 1.58/sql/sql_analyse.cc 2005-05-26 12:44:50 +02:00
@@ -23,7 +23,7 @@
** - type set is out of optimization yet
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.19/sql/sql_analyse.h 2005-02-08 23:49:34 +01:00
+++ 1.20/sql/sql_analyse.h 2005-05-26 12:44:50 +02:00
@@ -17,7 +17,7 @@
/* Analyse database */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_INTERFACE
#pragma interface /* gcc class implementation */
#endif
--- 1.178/sql/sql_class.cc 2005-05-23 23:43:38 +02:00
+++ 1.179/sql/sql_class.cc 2005-05-26 12:44:50 +02:00
@@ -22,7 +22,7 @@
**
*****************************************************************************/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.144/sql/sql_lex.cc 2005-05-19 03:48:17 +02:00
+++ 1.145/sql/sql_lex.cc 2005-05-26 12:44:50 +02:00
@@ -423,7 +423,7 @@
static const char *unsigned_longlong_str="18446744073709551615";
static const uint unsigned_longlong_len=20;
-inline static uint int_token(const char *str,uint length)
+static inline uint int_token(const char *str,uint length)
{
if (length < long_len) // quick normal case
return NUM;
--- 1.10/sql/sql_map.cc 2005-02-24 09:17:53 +01:00
+++ 1.11/sql/sql_map.cc 2005-05-26 12:44:50 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.434/sql/sql_parse.cc 2005-05-24 16:51:58 +02:00
+++ 1.435/sql/sql_parse.cc 2005-05-26 12:54:48 +02:00
@@ -3175,8 +3175,34 @@
select_lex->options|= SELECT_NO_UNLOCK;
select_result *result;
+ unit->offset_limit_cnt= select_lex->offset_limit;
+ unit->select_limit_cnt= select_lex->select_limit+select_lex->offset_limit;
+ if (unit->select_limit_cnt < select_lex->select_limit)
+ unit->select_limit_cnt= HA_POS_ERROR; // No limit
unit->set_limit(select_lex, select_lex);
+ if (find_real_table_in_list(tables->next, tables->db, tables->real_name))
+ {
+ /* Using same table for INSERT and SELECT */
+ select_lex->options |= OPTION_BUFFER_RESULT;
+ }
+
+ if ((res= open_and_lock_tables(thd, tables)))
+ break;
+
+ TABLE *table= tables->table;
+ /* Skip first table, which is the table we are inserting in */
+ select_lex->table_list.first= (byte*) first_local_table->next;
+ tables= (TABLE_LIST *) select_lex->table_list.first;
+ first_local_table->next= 0;
+
+ if (!(res= mysql_prepare_insert(thd, tables, first_local_table,
+ table, lex->field_list, 0,
+ lex->update_list, lex->value_list,
+ lex->duplicates)) &&
+ (result= new select_insert(table, &lex->field_list,
+ &lex->update_list, &lex->value_list,
+ lex->duplicates, lex->ignore)))
if (!(res= open_and_lock_tables(thd, all_tables)))
{
/* Skip first table, which is the table we are inserting in */
--- 1.325/sql/sql_select.cc 2005-05-25 17:33:26 +02:00
+++ 1.326/sql/sql_select.cc 2005-05-26 12:44:51 +02:00
@@ -17,7 +17,7 @@
/* mysql_select and join optimization */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.85/sql/sql_string.cc 2005-03-16 15:10:55 +01:00
+++ 1.86/sql/sql_string.cc 2005-05-26 12:44:51 +02:00
@@ -16,7 +16,7 @@
/* This file is originally from the mysql distribution. Coded by monty */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.47/sql/sql_udf.cc 2005-05-19 22:50:40 +02:00
+++ 1.48/sql/sql_udf.cc 2005-05-26 12:44:51 +02:00
@@ -28,7 +28,7 @@
dynamic functions, so this shouldn't be a real problem.
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: implement sql_udf.h
#endif
--- 1.381/sql/sql_yacc.yy 2005-05-25 18:54:59 +02:00
+++ 1.382/sql/sql_yacc.yy 2005-05-26 12:44:51 +02:00
@@ -3972,7 +3972,7 @@
select_into select_lock_type;
select_into:
- opt_limit_clause {}
+ opt_order_clause opt_limit_clause {}
| into
| select_from
| into select_from
--- 1.71/mysql-test/r/union.result 2005-05-05 22:01:35 +02:00
+++ 1.72/mysql-test/r/union.result 2005-05-26 12:54:48 +02:00
@@ -1201,27 +1201,27 @@
value is: 6
some text
CREATE TABLE t1 (
+a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
b ENUM("one", "two") character set utf8,
c ENUM("one", "two")
);
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
+ `a` enum('ä','ö','ü') character set utf8 NOT NULL default 'ü',
`b` enum('one','two') character set utf8 default NULL,
`c` enum('one','two') default NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
+insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
create table t2 select NULL union select a from t1;
show columns from t2;
Field Type Null Key Default Extra
+NULL enum('ä','ö','ü') YES NULL
drop table t2;
create table t2 select a from t1 union select NULL;
show columns from t2;
Field Type Null Key Default Extra
+a enum('ä','ö','ü') YES NULL
drop table t2;
create table t2 select a from t1 union select a from t1;
show columns from t2;
@@ -1235,6 +1235,25 @@
Field Type Null Key Default Extra
a varchar(3) YES NULL
drop table t2, t1;
+create table t1 ( id int not null auto_increment, primary key (id), col1 int);
+insert into t1 (col1) values (2),(3),(4),(5),(6);
+select 99 union all select id from t1 order by 1;
+99
+1
+2
+3
+4
+5
+99
+select id from t1 union all select 99 order by 1;
+id
+1
+2
+3
+4
+5
+99
+drop table t1;
create table t1 (a varchar(5));
create table t2 select * from t1 union select 'abcdefghijkl';
show create table t2;
--- 1.85/mysql-test/t/union.test 2005-04-11 12:08:58 +02:00
+++ 1.86/mysql-test/t/union.test 2005-05-26 12:54:48 +02:00
@@ -740,12 +740,12 @@
# Enum merging test
#
CREATE TABLE t1 (
+ a ENUM('ä','ö','ü') character set utf8 not null default 'ü',
b ENUM("one", "two") character set utf8,
c ENUM("one", "two")
);
show create table t1;
+insert into t1 values ('ä', 'one', 'one'), ('ö', 'two', 'one'), ('ü', NULL, NULL);
create table t2 select NULL union select a from t1;
show columns from t2;
drop table t2;
@@ -760,6 +760,17 @@
create table t2 select a from t1 union select b from t1;
show columns from t2;
drop table t2, t1;
+
+
+#
+# Bug #10032 Bug in parsing UNION with ORDER BY when one node does not use FROM
+#
+
+create table t1 ( id int not null auto_increment, primary key (id), col1 int);
+insert into t1 (col1) values (2),(3),(4),(5),(6);
+select 99 union all select id from t1 order by 1;
+select id from t1 union all select 99 order by 1;
+drop table t1;
#
# Test that union with VARCHAR produces dynamic row tables
--- 1.15/sql/sql_olap.cc 2004-11-25 01:23:08 +01:00
+++ 1.16/sql/sql_olap.cc 2005-05-26 12:44:50 +02:00
@@ -28,7 +28,7 @@
#ifdef DISABLED_UNTIL_REWRITTEN_IN_4_1
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.99/sql/item_subselect.cc 2005-04-01 01:13:23 +02:00
+++ 1.100/sql/item_subselect.cc 2005-05-26 12:44:49 +02:00
@@ -22,7 +22,7 @@
(sql_select.h/sql_select.cc)
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.7/sql/ha_blackhole.cc 2005-05-14 10:36:56 +02:00
+++ 1.8/sql/ha_blackhole.cc 2005-05-26 12:44:47 +02:00
@@ -15,7 +15,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.20/sql/tztime.cc 2005-03-22 00:24:59 +01:00
+++ 1.21/sql/tztime.cc 2005-05-26 12:44:51 +02:00
@@ -20,7 +20,7 @@
(We will refer to this code as to elsie-code further.)
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.11/sql/protocol_cursor.cc 2005-02-19 17:58:21 +01:00
+++ 1.12/sql/protocol_cursor.cc 2005-05-26 12:44:50 +02:00
@@ -19,7 +19,7 @@
The actual communction is handled by the net_xxx functions in net_serv.cc
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.39/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2005-01-19 09:26:43 +01:00
+++ 1.40/ndb/src/kernel/blocks/dbtux/Dbtux.hpp 2005-05-26 12:44:47 +02:00
@@ -342,7 +342,6 @@
* Complete metadata for one index. The array of attributes has
* variable size.
*/
- struct DescEnt;
friend struct DescEnt;
struct DescEnt {
DescHead m_descHead;
--- 1.178/sql/ha_ndbcluster.cc 2005-05-18 20:51:38 +02:00
+++ 1.179/sql/ha_ndbcluster.cc 2005-05-26 12:44:48 +02:00
@@ -20,7 +20,7 @@
NDB Cluster
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.61/mysql-test/r/select.result 2005-05-19 20:54:28 +02:00
+++ 1.62/mysql-test/r/select.result 2005-05-26 12:44:47 +02:00
@@ -2676,3 +2676,9 @@
COUNT(*)
0
drop table t1;
+CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
+INSERT INTO t1 VALUES (0x8000000000000000);
+SELECT b FROM t1 WHERE b=0x8000000000000000;
+b
+9223372036854775808
+DROP TABLE t1;
--- 1.46/mysql-test/t/select.test 2005-05-19 15:20:02 +02:00
+++ 1.47/mysql-test/t/select.test 2005-05-26 12:54:48 +02:00
@@ -1998,6 +1998,15 @@
drop table t1;
#
+
+#
+# Test for Bug#8009, SELECT failed on bigint unsigned when using HEX
+#
+
+CREATE TABLE t1 (b BIGINT(20) UNSIGNED NOT NULL, PRIMARY KEY (b));
+INSERT INTO t1 VALUES (0x8000000000000000);
+SELECT b FROM t1 WHERE b=0x8000000000000000;
+DROP TABLE t1;
# Test for bug #6474
#
--- 1.210/sql/ha_innodb.cc 2005-05-21 17:12:28 +02:00
+++ 1.211/sql/ha_innodb.cc 2005-05-26 12:44:48 +02:00
@@ -27,7 +27,7 @@
in Windows?
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.35/client/client_priv.h 2005-05-14 19:28:15 +02:00
+++ 1.36/client/client_priv.h 2005-05-26 12:54:48 +02:00
@@ -49,5 +49,5 @@
#ifdef HAVE_NDBCLUSTER_DB
OPT_NDBCLUSTER, OPT_NDB_CONNECTSTRING,
#endif
- OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS
+ OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE
};
--- 1.88/include/my_global.h 2005-05-23 20:20:21 +02:00
+++ 1.89/include/my_global.h 2005-05-26 12:44:47 +02:00
@@ -48,6 +48,11 @@
#define USE_PRAGMA_INTERFACE
#endif
+/* Determine when to use "#pragma implementation" */
+#if !defined(__INTEL_COMPILER) && defined(__GNUC__) && (__GNUC__ < 3)
+#define USE_PRAGMA_IMPLEMENTATION
+#endif
+
#if defined(i386) && !defined(__i386__)
#define __i386__
#endif
@@ -310,12 +315,14 @@
#endif
#if defined(__ia64__)
#define new my_arg_new
+#define need_to_restore_new 1
#endif
C_MODE_START
#include <asm/atomic.h>
C_MODE_END
-#if defined(__ia64__)
+#ifdef need_to_restore_new /* probably safer than #ifdef new */
#undef new
+#undef need_to_restore_new
#endif
#endif
#include <errno.h> /* Recommended by debian */
--- 1.112/sql/set_var.cc 2005-05-18 11:46:02 +02:00
+++ 1.113/sql/set_var.cc 2005-05-26 12:44:50 +02:00
@@ -48,7 +48,7 @@
new attribute.
*/
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.43/mysql-test/r/mysqldump.result 2005-05-19 00:40:31 +02:00
+++ 1.44/mysql-test/r/mysqldump.result 2005-05-26 12:44:47 +02:00
@@ -1384,3 +1384,41 @@
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
drop table t1;
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1),(2),(3);
+
+/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
+/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
+/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
+/*!40101 SET NAMES utf8 */;
+/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
+/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
+/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
+/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
+
+/*!40000 DROP DATABASE IF EXISTS `test`*/;
+
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `test` /*!40100 DEFAULT CHARACTER SET latin1 */;
+
+USE `test`;
+DROP TABLE IF EXISTS `t1`;
+CREATE TABLE `t1` (
+ `a` int(11) default NULL
+) ENGINE=MyISAM DEFAULT CHARSET=latin1;
+
+
+/*!40000 ALTER TABLE `t1` DISABLE KEYS */;
+LOCK TABLES `t1` WRITE;
+INSERT INTO `t1` VALUES (1),(2),(3);
+UNLOCK TABLES;
+/*!40000 ALTER TABLE `t1` ENABLE KEYS */;
+
+/*!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 TABLE t1;
--- 1.37/mysql-test/t/mysqldump.test 2005-05-18 20:06:31 +02:00
+++ 1.38/mysql-test/t/mysqldump.test 2005-05-26 12:44:47 +02:00
@@ -554,3 +554,12 @@
insert into t1 (F_8d3bba7425e7c98c50f52ca1b52d3735) values (1);
--exec $MYSQL_DUMP --skip-comments -c test
drop table t1;
+
+#
+# Test for --add-drop-database
+#
+
+CREATE TABLE t1 (a int);
+INSERT INTO t1 VALUES (1),(2),(3);
+--exec $MYSQL_DUMP --add-drop-database --skip-comments --databases test
+DROP TABLE t1;
--- 1.21/sql/item_geofunc.cc 2005-04-29 17:21:57 +02:00
+++ 1.22/sql/item_geofunc.cc 2005-05-26 12:44:48 +02:00
@@ -17,7 +17,7 @@
/* This file defines all spatial functions */
-#ifdef __GNUC__
+#ifdef USE_PRAGMA_IMPLEMENTATION
#pragma implementation // gcc: Class implementation
#endif
--- 1.136/sql/sql_repl.cc 2005-05-24 16:52:44 +02:00
+++ 1.137/sql/sql_repl.cc 2005-05-26 12:54:49 +02:00
@@ -149,6 +149,42 @@
}
+File open_binlog(IO_CACHE *log, const char *log_file_name,
+ const char **errmsg)
+{
+ File file;
+ DBUG_ENTER("open_binlog");
+
+ if ((file = my_open(log_file_name, O_RDONLY | O_BINARY | O_SHARE,
+ MYF(MY_WME))) < 0)
+ {
+ sql_print_error("Failed to open log (\
+file '%s', errno %d)", log_file_name, my_errno);
+ *errmsg = "Could not open log file"; // This will not be sent
+ goto err;
+ }
+ if (init_io_cache(log, file, IO_SIZE*2, READ_CACHE, 0, 0,
+ MYF(MY_WME | MY_DONT_CHECK_FILESIZE)))
+ {
+ sql_print_error("Failed to create a cache on log (\
+file '%s')", log_file_name);
+ *errmsg = "Could not open log file"; // This will not be sent
+ goto err;
+ }
+ if (check_binlog_magic(log,errmsg))
+ goto err;
+ DBUG_RETURN(file);
+
+err:
+ if (file >= 0)
+ {
+ my_close(file,MYF(0));
+ end_io_cache(log);
+ }
+ DBUG_RETURN(-1);
+}
+
+
/*
Adjust the position pointer in the binary log file for all running slaves
@@ -1479,13 +1515,11 @@
{
IO_CACHE *index_file;
LOG_INFO cur;
- IO_CACHE log;
File file;
- const char *errmsg= 0;
- MY_STAT stat_area;
char fname[FN_REFLEN];
List<Item> field_list;
uint length;
+ int cur_dir_len;
Protocol *protocol= thd->protocol;
DBUG_ENTER("show_binlogs");
@@ -1505,34 +1539,35 @@
index_file=mysql_bin_log.get_index_file();
mysql_bin_log.get_current_log(&cur);
- int cur_dir_len = dirname_length(cur.log_file_name);
+ cur_dir_len= dirname_length(cur.log_file_name);
reinit_io_cache(index_file, READ_CACHE, (my_off_t) 0, 0, 0);
/* The file ends with EOF or empty line */
while ((length=my_b_gets(index_file, fname, sizeof(fname))) > 1)
{
- fname[--length] = '\0'; /* remove the newline */
+ int dir_len;
+ ulonglong file_length= 0; // Length if open fails
+ fname[--length] = '\0'; // remove the newline
protocol->prepare_for_resend();
- int dir_len = dirname_length(fname);
- protocol->store(fname + dir_len, length-dir_len, &my_charset_bin);
- if(!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length-dir_len)))
+ dir_len= dirname_length(fname);
+ length-= dir_len;
+ protocol->store(fname + dir_len, length, &my_charset_bin);
+
+ if (!(strncmp(fname+dir_len, cur.log_file_name+cur_dir_len, length)))
+ file_length= cur.pos; /* The active log, use the active position */
+ else
{
- /* this is the active log, use the active position */
- protocol->store((ulonglong) cur.pos);
- } else {
/* this is an old log, open it and find the size */
- if ((file=open_binlog(&log, fname+dir_len, &errmsg)) >= 0)
+ if ((file= my_open(fname+dir_len, O_RDONLY | O_SHARE | O_BINARY,
+ MYF(0))) >= 0)
{
- protocol->store((ulonglong) my_b_filelength(&log));
- end_io_cache(&log);
+ file_length= (ulonglong) my_seek(file, 0L, MY_SEEK_END, MYF(0));
my_close(file, MYF(0));
- } else {
- /* the file wasn't openable, but 0 is an invalid value anyway */
- protocol->store((ulonglong) 0);
}
}
+ protocol->store(file_length);
if (protocol->write())
goto err;
}
| Thread |
|---|
| • bk commit into 5.0 tree (msvensson:1.1919) | msvensson | 27 May |