Biping MENG wrote:
Hi, Drizzlers
Here I'm suffering from a bug about auto_increment:
"alter table auto_increment" command does not work when using heap
engine (not confirmed with other engines yet)
platform:
ubuntu 9.04 desktop 32bits
trunck:
revision 1095
A session exposing the bug:
drizzle> create TEMPORARY table t1(id int primary key auto_increment)
engine=heap;
Query OK, 0 rows affected (0.03 sec)
drizzle> insert into t1 values (null);
Query OK, 1 row affected (0 sec)
drizzle> insert into t1 values (null);
Query OK, 1 row affected (0 sec)
drizzle> select * from t1;
+----+
| id |
+----+
| 1 |
| 2 |
+----+
2 rows in set (0 sec)
drizzle> alter table t1 auto_increment = 50;
Query OK, 2 rows affected (0 sec)
Records: 2 Duplicates: 0 Warnings: 0
drizzle> show create table t1;
+-------+-------------------------------------------------------------------------------------------------------------------------+
| Table | Create Table
|
+-------+-------------------------------------------------------------------------------------------------------------------------+
| t1 | CREATE TEMPORARY TABLE `t1` (
`id` int NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`id`)
) ENGINE=MEMORY AUTO_INCREMENT=3 |
+-------+-------------------------------------------------------------------------------------------------------------------------+
1 row in set (0 sec)
drizzle> insert into t1 values (null);
Query OK, 1 row affected (0 sec)
drizzle> select * from t1;
+----+
| id |
+----+
| 1 |
| 2 |
| 3 |
+----+
3 rows in set (0 sec)
What I know by now:
1. When I run ./dtr, the alter_table test fails due to this bug.
2. As is suggested by Stewart, I added a SHOW CREATE TABLE command
right after the "ALTER TABLE t1 auto_increment=50" command (also shown
in the above session), and found that the auto_increment value is not
changed by the alter command at all.
3. I gdbed into the code with ./dtr --gdb, and found that when
executing the alter command, a new table is created and the parameter
HP_CREATE_INFO *create_info passed to the function call
HeapEngine::heap_create_table is correct, that is:
create_info->auto_increment_value == 50 && (create_info->used_fields &
HA_CREATE_USED_AUTO)
4. When I start drizzled with simplified parameters, that is
./drizzled --port=xxxx, the alter command just works fine. Then I
tried the parameters given by ./dtr, the bug recurs. It's weird. After
several tries on the parameters I found that if and only if --tmpdir
is specified, the bug recurs; otherwise not.
That's good information...I'll ask Joe Daly on the bug below if this is
the same with his setup...
Not sure if there's something to do with this known bug:
https://bugs.launchpad.net/drizzle/+bug/314570
Actually, I think it might be this bug:
https://bugs.launchpad.net/drizzle/+bug/385808
I will take a look into it. Possibly a regression introduced in
Stewart's MyISAM as tmp table branch, but not sure...
Cheers,
Jay
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp