Below is the list of changes that have just been committed into a local
5.1 repository of kostja. When kostja 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.2091 06/02/08 23:53:45 konstantin@stripped +18 -0
Merge mysql.com:/home/kostja/mysql/tmp_merge
into mysql.com:/home/kostja/mysql/mysql-5.1-merge
tests/mysql_client_test.c
1.172 06/02/08 23:53:37 konstantin@stripped +0 -0
SCCS merged
sql/sql_update.cc
1.187 06/02/08 23:53:01 konstantin@stripped +6 -0
Manual merge
storage/ndb/test/ndbapi/testBlobs.cpp
1.29 06/02/08 23:52:06 konstantin@stripped +0 -0
Auto merged
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
1.25 06/02/08 23:52:06 konstantin@stripped +0 -0
Auto merged
storage/heap/hp_create.c
1.24 06/02/08 23:52:06 konstantin@stripped +0 -0
Auto merged
sql/sql_select.h
1.104 06/02/08 23:52:05 konstantin@stripped +0 -0
Auto merged
sql/sql_select.cc
1.387 06/02/08 23:52:05 konstantin@stripped +0 -0
Auto merged
sql/sql_parse.cc
1.518 06/02/08 23:52:05 konstantin@stripped +0 -0
Auto merged
sql/sql_class.cc
1.243 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
sql/sql_base.cc
1.299 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
sql/item_timefunc.cc
1.106 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
sql/ha_heap.h
1.43 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
sql/ha_heap.cc
1.81 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
mysql-test/t/date_formats.test
1.17 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
mysql-test/r/date_formats.result
1.22 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
libmysql/libmysql.c
1.234 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
include/heap.h
1.26 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
configure.in
1.338 06/02/08 23:52:04 konstantin@stripped +0 -0
Auto merged
storage/ndb/test/ndbapi/testBlobs.cpp
1.20.10.2 06/02/08 23:52:03 konstantin@stripped +0 -0
Merge rename: ndb/test/ndbapi/testBlobs.cpp -> storage/ndb/test/ndbapi/testBlobs.cpp
storage/ndb/include/mgmapi/mgmapi_config_parameters.h
1.17.3.2 06/02/08 23:52:03 konstantin@stripped +0 -0
Merge rename: ndb/include/mgmapi/mgmapi_config_parameters.h -> storage/ndb/include/mgmapi/mgmapi_config_parameters.h
storage/heap/hp_create.c
1.20.2.2 06/02/08 23:52:03 konstantin@stripped +0 -0
Merge rename: heap/hp_create.c -> storage/heap/hp_create.c
# 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: konstantin
# Host: oak.local
# Root: /home/kostja/mysql/mysql-5.1-merge/RESYNC
--- 1.337/configure.in 2006-02-05 12:06:04 +03:00
+++ 1.338/configure.in 2006-02-08 23:52:04 +03:00
@@ -343,7 +343,7 @@
# libmysqlclient versioning when linked with GNU ld.
if $LD --version 2>/dev/null|grep -q GNU; then
- LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_srcdir)/libmysql/libmysql.ver"
+ LD_VERSION_SCRIPT="-Wl,--version-script=\$(top_builddir)/libmysql/libmysql.ver"
AC_CONFIG_FILES(libmysql/libmysql.ver)
fi
AC_SUBST(LD_VERSION_SCRIPT)
--- 1.20.2.1/heap/hp_create.c 2006-02-02 17:25:21 +03:00
+++ 1.24/storage/heap/hp_create.c 2006-02-08 23:52:06 +03:00
@@ -235,6 +235,16 @@
HP_PTRS_IN_NOD * block->level_info[i - 1].records_under_level);
}
+
+static inline void heap_try_free(HP_SHARE *share)
+{
+ if (share->open_count == 0)
+ hp_free(share);
+ else
+ share->delete_on_close= 1;
+}
+
+
int heap_delete_table(const char *name)
{
int result;
@@ -244,10 +254,7 @@
pthread_mutex_lock(&THR_LOCK_heap);
if ((share= hp_find_named_heap(name)))
{
- if (share->open_count == 0)
- hp_free(share);
- else
- share->delete_on_close= 1;
+ heap_try_free(share);
result= 0;
}
else
@@ -257,6 +264,17 @@
pthread_mutex_unlock(&THR_LOCK_heap);
DBUG_RETURN(result);
}
+
+
+void heap_drop_table(HP_INFO *info)
+{
+ DBUG_ENTER("heap_drop_table");
+ pthread_mutex_lock(&THR_LOCK_heap);
+ heap_try_free(info->s);
+ pthread_mutex_unlock(&THR_LOCK_heap);
+ DBUG_VOID_RETURN;
+}
+
void hp_free(HP_SHARE *share)
{
--- 1.25/include/heap.h 2005-11-06 10:28:50 +03:00
+++ 1.26/include/heap.h 2006-02-08 23:52:04 +03:00
@@ -136,6 +136,7 @@
HP_KEYDEF *keydef;
ulong min_records,max_records; /* Params to open */
ulong data_length,index_length,max_table_size;
+ uint key_stat_version; /* version to indicate insert/delete */
uint records; /* records */
uint blength; /* records rounded up to 2^n */
uint deleted; /* Deleted records in database */
--- 1.233/libmysql/libmysql.c 2006-02-02 18:17:12 +03:00
+++ 1.234/libmysql/libmysql.c 2006-02-08 23:52:04 +03:00
@@ -2722,13 +2722,13 @@
/* Send row request to the server */
int4store(buff, stmt->stmt_id);
int4store(buff + 4, stmt->prefetch_rows); /* number of rows to fetch */
- if (cli_advanced_command(mysql, COM_STMT_FETCH, buff, sizeof(buff),
- NullS, 0, 1))
+ if ((*mysql->methods->advanced_command)(mysql, COM_STMT_FETCH,
+ buff, sizeof(buff), NullS, 0, 1))
{
set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate);
return 1;
}
- if (cli_read_binary_rows(stmt))
+ if ((*mysql->methods->read_rows_from_cursor)(stmt))
return 1;
stmt->server_status= mysql->server_status;
@@ -5107,9 +5107,9 @@
DBUG_ENTER("mysql_autocommit");
DBUG_PRINT("enter", ("mode : %d", auto_mode));
- if (auto_mode) /* set to true */
- DBUG_RETURN((my_bool) mysql_real_query(mysql, "set autocommit=1", 16));
- DBUG_RETURN((my_bool) mysql_real_query(mysql, "set autocommit=0", 16));
+ DBUG_RETURN((my_bool) mysql_real_query(mysql, auto_mode ?
+ "set autocommit=1":"set autocommit=0",
+ 16));
}
--- 1.80/sql/ha_heap.cc 2006-01-28 06:16:18 +03:00
+++ 1.81/sql/ha_heap.cc 2006-02-08 23:52:04 +03:00
@@ -73,7 +73,7 @@
ha_heap::ha_heap(TABLE_SHARE *table_arg)
:handler(&heap_hton, table_arg), file(0), records_changed(0),
- key_stats_ok(0)
+ key_stats_version(0)
{}
@@ -124,7 +124,7 @@
ha_heap::info(), which is always called before key statistics are
used.
*/
- key_stats_ok= FALSE;
+ key_stat_version= file->s->key_stat_version-1;
}
return (file ? 0 : 1);
}
@@ -171,14 +171,21 @@
continue;
if (key->algorithm != HA_KEY_ALG_BTREE)
{
- ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
- key->rec_per_key[key->key_parts-1]=
- hash_buckets ? file->s->records/hash_buckets : 0;
+ if (key->flags & HA_NOSAME)
+ key->rec_per_key[key->key_parts-1]= 1;
+ else
+ {
+ ha_rows hash_buckets= file->s->keydef[i].hash_buckets;
+ uint no_records= hash_buckets ? file->s->records/hash_buckets : 2;
+ if (no_records < 2)
+ no_records= 2;
+ key->rec_per_key[key->key_parts-1]= no_records;
+ }
}
}
records_changed= 0;
/* At the end of update_key_stats() we can proudly claim they are OK. */
- key_stats_ok= TRUE;
+ key_stat_version= file->s->key_stat_version;
}
@@ -193,7 +200,13 @@
res= heap_write(file,buf);
if (!res && (++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
file->s->records))
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return res;
}
@@ -206,7 +219,13 @@
res= heap_update(file,old_data,new_data);
if (!res && ++records_changed*HEAP_STATS_UPDATE_THRESHOLD >
file->s->records)
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return res;
}
@@ -217,7 +236,13 @@
res= heap_delete(file,buf);
if (!res && table->s->tmp_table == NO_TMP_TABLE &&
++records_changed*HEAP_STATS_UPDATE_THRESHOLD > file->s->records)
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return res;
}
@@ -344,7 +369,7 @@
have to update the key statistics. Hoping that a table lock is now
in place.
*/
- if (! key_stats_ok)
+ if (key_stat_version != file->s->key_stat_version)
update_key_stats();
}
@@ -357,7 +382,13 @@
{
heap_clear(file);
if (table->s->tmp_table == NO_TMP_TABLE)
- key_stats_ok= FALSE;
+ {
+ /*
+ We can perform this safely since only one writer at the time is
+ allowed on the table.
+ */
+ file->s->key_stat_version++;
+ }
return 0;
}
@@ -523,6 +554,9 @@
min_key->flag != HA_READ_KEY_EXACT ||
max_key->flag != HA_READ_AFTER_KEY)
return HA_POS_ERROR; // Can only use exact keys
+
+ if (records <= 1)
+ return records;
/* Assert that info() did run. We need current statistics here. */
DBUG_ASSERT(key_stats_ok);
--- 1.42/sql/ha_heap.h 2005-11-23 23:44:55 +03:00
+++ 1.43/sql/ha_heap.h 2006-02-08 23:52:04 +03:00
@@ -29,7 +29,7 @@
key_map btree_keys;
/* number of records changed since last statistics update */
uint records_changed;
- bool key_stats_ok;
+ uint key_stat_version;
public:
ha_heap(TABLE_SHARE *table);
~ha_heap() {}
--- 1.242/sql/sql_class.cc 2006-02-02 17:22:23 +03:00
+++ 1.243/sql/sql_class.cc 2006-02-08 23:52:04 +03:00
@@ -1862,11 +1862,14 @@
void TMP_TABLE_PARAM::init()
{
+ DBUG_ENTER("TMP_TABLE_PARAM::init");
+ DBUG_PRINT("enter", ("this: 0x%lx", (ulong)this));
field_count= sum_func_count= func_count= hidden_field_count= 0;
group_parts= group_length= group_null_parts= 0;
quick_group= 1;
table_charset= 0;
precomputed_group_by= 0;
+ DBUG_VOID_RETURN;
}
--- 1.386/sql/sql_select.cc 2006-02-07 15:26:16 +03:00
+++ 1.387/sql/sql_select.cc 2006-02-08 23:52:05 +03:00
@@ -6064,6 +6064,20 @@
problems in free_elements() as some of the elements are then deleted.
*/
tmp_table_param.copy_funcs.empty();
+ /*
+ If we have tmp_join and 'this' JOIN is not tmp_join and
+ tmp_table_param.copy_field's of them are equal then we have to remove
+ pointer to tmp_table_param.copy_field from tmp_join, because it qill
+ be removed in tmp_table_param.cleanup().
+ */
+ if (tmp_join &&
+ tmp_join != this &&
+ tmp_join->tmp_table_param.copy_field ==
+ tmp_table_param.copy_field)
+ {
+ tmp_join->tmp_table_param.copy_field=
+ tmp_join->tmp_table_param.save_copy_field= 0;
+ }
tmp_table_param.cleanup();
}
DBUG_VOID_RETURN;
--- 1.103/sql/sql_select.h 2005-12-09 14:39:41 +03:00
+++ 1.104/sql/sql_select.h 2006-02-08 23:52:05 +03:00
@@ -286,7 +286,14 @@
{
init(thd_arg, fields_arg, select_options_arg, result_arg);
}
-
+
+ JOIN(JOIN &join)
+ :fields_list(join.fields_list)
+ {
+ init(join.thd, join.fields_list, join.select_options,
+ join.result);
+ }
+
void init(THD *thd_arg, List<Item> &fields_arg, ulonglong select_options_arg,
select_result *result_arg)
{
@@ -333,7 +340,7 @@
all_fields= fields_arg;
fields_list= fields_arg;
bzero((char*) &keyuse,sizeof(keyuse));
- tmp_table_param.copy_field=0;
+ tmp_table_param.init();
tmp_table_param.end_write_records= HA_POS_ERROR;
rollup.state= ROLLUP::STATE_NONE;
}
--- 1.186/sql/sql_update.cc 2006-02-06 18:33:31 +03:00
+++ 1.187/sql/sql_update.cc 2006-02-08 23:53:01 +03:00
@@ -331,7 +331,6 @@
SORT_FIELD *sortorder;
ha_rows examined_rows;
- used_index= MAX_KEY; // For call to init_read_record()
table->sort.io_cache = (IO_CACHE *) my_malloc(sizeof(IO_CACHE),
MYF(MY_FAE | MY_ZEROFILL));
if (!(sortorder=make_unireg_sortorder(order, &length)) ||
@@ -362,7 +361,21 @@
if (open_cached_file(&tempfile, mysql_tmpdir,TEMP_PREFIX,
DISK_BUFFER_SIZE, MYF(MY_WME)))
goto err;
-
+
+ /* If quick select is used, initialize it before retrieving rows. */
+ if (select && select->quick && select->quick->reset())
+ goto err;
+
+ /*
+ When we get here, we have one of the following options:
+ A. used_index == MAX_KEY
+ This means we should use full table scan, and start it with
+ init_read_record call
+ B. used_index != MAX_KEY
+ B.1 quick select is used, start the scan with init_read_record
+ B.2 quick select is not used, this is full index scan (with LIMIT)
+ Full index scan must be started with init_read_record_idx
+ */
/* If quick select is used, initialize it before retrieving rows. */
if (select && select->quick && select->quick->reset())
goto err;
--- 1.17.3.1/ndb/include/mgmapi/mgmapi_config_parameters.h 2006-02-02 17:25:22 +03:00
+++ 1.25/storage/ndb/include/mgmapi/mgmapi_config_parameters.h 2006-02-08 23:52:06 +03:00
@@ -4,7 +4,6 @@
#define CFG_SYS_NAME 3
#define CFG_SYS_PRIMARY_MGM_NODE 1
#define CFG_SYS_CONFIG_GENERATION 2
-#define CFG_SYS_REPLICATION_ROLE 7
#define CFG_SYS_PORT_BASE 8
#define CFG_NODE_ID 3
@@ -91,6 +90,9 @@
#define CFG_DB_DATA_MEM_2 199 /* used in special build in 5.1 */
+#define CFG_DB_DISK_PAGE_BUFFER_MEMORY 160
+#define CFG_DB_STRING_MEMORY 161
+
#define CFG_NODE_ARBIT_RANK 200
#define CFG_NODE_ARBIT_DELAY 201
@@ -145,8 +147,6 @@
#define CFG_OSE_PRIO_B_SIZE 603
#define CFG_OSE_RECEIVE_ARRAY_SIZE 604
-#define CFG_REP_HEARTBEAT_INTERVAL 700
-
/**
* API Config variables
*
@@ -168,8 +168,6 @@
#define NODE_TYPE_DB 0
#define NODE_TYPE_API 1
#define NODE_TYPE_MGM 2
-#define NODE_TYPE_REP 3
-#define NODE_TYPE_EXT_REP 4
#define CONNECTION_TYPE_TCP 0
#define CONNECTION_TYPE_SHM 1
--- 1.171/tests/mysql_client_test.c 2006-02-07 22:54:35 +03:00
+++ 1.172/tests/mysql_client_test.c 2006-02-08 23:53:37 +03:00
@@ -14714,6 +14714,56 @@
mysql_stmt_close(stmt);
}
+
+static void test_bug12744()
+{
+ MYSQL_STMT *prep_stmt = NULL;
+ int rc;
+ myheader("test_bug12744");
+
+ prep_stmt= mysql_stmt_init(mysql);
+ rc= mysql_stmt_prepare(prep_stmt, "SELECT 1", 8);
+ DIE_UNLESS(rc==0);
+
+ rc= mysql_kill(mysql, mysql_thread_id(mysql));
+ DIE_UNLESS(rc==0);
+
+ if (rc= mysql_stmt_execute(prep_stmt))
+ {
+ if (rc= mysql_stmt_reset(prep_stmt))
+ printf("OK!\n");
+ else
+ {
+ printf("Error!");
+ DIE_UNLESS(1==0);
+ }
+ }
+ else
+ {
+ fprintf(stderr, "expected error but no error occured\n");
+ DIE_UNLESS(1==0);
+ }
+ rc= mysql_stmt_close(prep_stmt);
+}
+
+/* Bug #16144: mysql_stmt_attr_get type error */
+
+static void test_bug16144()
+{
+ const my_bool flag_orig= (my_bool) 0xde;
+ my_bool flag= flag_orig;
+ MYSQL_STMT *stmt;
+ myheader("test_bug16144");
+
+ /* Check that attr_get returns correct data on little and big endian CPUs */
+ stmt= mysql_stmt_init(mysql);
+ mysql_stmt_attr_set(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (const void*) &flag);
+ mysql_stmt_attr_get(stmt, STMT_ATTR_UPDATE_MAX_LENGTH, (void*) &flag);
+ DIE_UNLESS(flag == flag_orig);
+
+ mysql_stmt_close(stmt);
+}
+
/*
Bug #15613: "libmysqlclient API function mysql_stmt_prepare returns wrong
field length"
@@ -15038,6 +15088,7 @@
{ "test_bug14845", test_bug14845 },
{ "test_opt_reconnect", test_opt_reconnect },
{ "test_bug15510", test_bug15510},
+ { "test_bug12744", test_bug12744 },
{ "test_bug16144", test_bug16144 },
{ "test_bug15613", test_bug15613 },
{ 0, 0 }
| Thread |
|---|
| • bk commit into 5.1 tree (konstantin:1.2091) | Konstantin Osipov | 8 Feb |