On Fri, Jul 17, 2009 at 1:31 PM, Biping MENG<[email protected]> 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.
Here is the my drizzled command line started by ./dtr: /home/llml/Repos/drizzle/local_main_build/drizzled/drizzled --no-defaults --basedir=/home/llml/Repos/drizzle/local_main_build/tests --default-storage-engine=innodb --secure-file-priv=/home/llml/Repos/drizzle/local_main_build/tests/var --tmpdir=/home/llml/Repos/drizzle/local_main_build/tests/var/tmp --connect-timeout=60 --user=root --pid-file=/home/llml/Repos/drizzle/local_main_build/tests/var/run/master.pid --port=9306 --datadir=/home/llml/Repos/drizzle/local_main_build/tests/var/master-data --server-id=1 --loose-innodb_data_file_path=ibdata1:10M:autoextend --loose-innodb-lock-wait-timeout=5 --key_buffer_size=1M --sort_buffer=256K --max_heap_table_size=1M --core-file I tried more cases on the --tmpdir options, and get the following interesting results (all the involved directories are "mkdir -p"ed in advance): --tmpdir option: alter command test case: /home/llml/Repos/drizzle/local_main_build/tests/var/tmp failed not supplied passed /tmp passed /home/llml passed /home/llml/Repos failed /home/llml/repos passed /home/llml/repos/drizzle/local_main_build/tests/var/tmp passed /home/llml/repos/drizzle/local_main_build/tests/var/Tmp failed Generally it seems that if the --tmpdir option is supplied, the path should not contain any uppercase letters. And I found that it must be related with this bug: https://bugs.launchpad.net/drizzle/+bug/394272 > > Not sure if there's something to do with this known bug: > https://bugs.launchpad.net/drizzle/+bug/314570 > > Any ideas? > > -- > Cheers. > > Biping MENG > -- Cheers. Biping MENG
_______________________________________________ Mailing list: https://launchpad.net/~drizzle-discuss Post to : [email protected] Unsubscribe : https://launchpad.net/~drizzle-discuss More help : https://help.launchpad.net/ListHelp

