Commit 31322ca0 authored by svoj@june.mysql.com's avatar svoj@june.mysql.com

Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1

into  mysql.com:/home/svoj/devel/mysql/BUG26238/mysql-5.1-engines
parents 2baf35b4 ddb81312
...@@ -731,3 +731,10 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); ...@@ -731,3 +731,10 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
COUNT(*) COUNT(*)
2 2
DROP TABLE t1; DROP TABLE t1;
CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY;
INSERT INTO t1 VALUES('', 0);
ALTER TABLE t1 MODIFY c1 VARCHAR(101);
SELECT c2 FROM t1;
c2
0
DROP TABLE t1;
...@@ -471,3 +471,12 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256); ...@@ -471,3 +471,12 @@ SELECT COUNT(*) FROM t1 WHERE c=REPEAT('a',256);
DROP TABLE t1; DROP TABLE t1;
# End of 5.0 tests # End of 5.0 tests
#
# BUG#26080 - Memory Storage engine not working properly
#
CREATE TABLE t1(c1 VARCHAR(100), c2 INT) ENGINE=MEMORY;
INSERT INTO t1 VALUES('', 0);
ALTER TABLE t1 MODIFY c1 VARCHAR(101);
SELECT c2 FROM t1;
DROP TABLE t1;
...@@ -703,9 +703,10 @@ bool ha_heap::check_if_incompatible_data(HA_CREATE_INFO *info, ...@@ -703,9 +703,10 @@ bool ha_heap::check_if_incompatible_data(HA_CREATE_INFO *info,
uint table_changes) uint table_changes)
{ {
/* Check that auto_increment value was not changed */ /* Check that auto_increment value was not changed */
if ((table_changes != IS_EQUAL_YES && if ((info->used_fields & HA_CREATE_USED_AUTO &&
info->used_fields & HA_CREATE_USED_AUTO) && info->auto_increment_value != 0) ||
info->auto_increment_value != 0) table_changes == IS_EQUAL_NO ||
table_changes & IS_EQUAL_PACK_LENGTH) // Not implemented yet
return COMPATIBLE_DATA_NO; return COMPATIBLE_DATA_NO;
return COMPATIBLE_DATA_YES; return COMPATIBLE_DATA_YES;
} }
......
...@@ -506,22 +506,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -506,22 +506,6 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
share->data_file_type = DYNAMIC_RECORD; share->data_file_type = DYNAMIC_RECORD;
my_afree((gptr) disk_cache); my_afree((gptr) disk_cache);
mi_setup_functions(share); mi_setup_functions(share);
if (open_flags & HA_OPEN_MMAP)
{
info.s= share;
if (mi_dynmap_file(&info, share->state.state.data_file_length))
{
/* purecov: begin inspected */
/* Ignore if mmap fails. Use file I/O instead. */
DBUG_PRINT("warning", ("mmap failed: errno: %d", errno));
/* purecov: end */
}
else
{
share->file_read= mi_mmap_pread;
share->file_write= mi_mmap_pwrite;
}
}
share->is_log_table= FALSE; share->is_log_table= FALSE;
#ifdef THREAD #ifdef THREAD
thr_lock_init(&share->lock); thr_lock_init(&share->lock);
...@@ -552,6 +536,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags) ...@@ -552,6 +536,14 @@ MI_INFO *mi_open(const char *name, int mode, uint open_flags)
} }
} }
#endif #endif
/*
Memory mapping can only be requested after initializing intern_lock.
*/
if (open_flags & HA_OPEN_MMAP)
{
info.s= share;
mi_extra(&info, HA_EXTRA_MMAP, 0);
}
} }
else else
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment