shlomi-noach / openarkkit

Automatically exported from code.google.com/p/openarkkit
24 stars 16 forks source link

oak-online-alter-table: type mediumint not properly classed as integer #11

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
test@localhost> create table test_mi (id mediumint unsigned not null 
auto_increment primary key, stuff varchar(20) not null) engine innodb;
Query OK, 0 rows affected (0.04 sec)

test@localhost> insert into test_mi (stuff) values ("hello, world"), ("hello 
again");
Query OK, 1 row affected (0.00 sec)

3. oak-online-alter-table -d test -S /tmp/mysql.sock -t test_mi -a 'add column 
morestuff2 varchar(20)'

What is the expected output? What do you see instead?
-- Connecting to MySQL
-- Table test.test_mi is of engine innodb
-- Checking for UNIQUE columns on test.test_mi, by which to chunk
-- Possible UNIQUE KEY column names in test.test_mi:
-- - id
-- Table test.__oak_test_mi has been created
-- Table test.__oak_test_mi has been altered
-- Checking for UNIQUE columns on test.__oak_test_mi, by which to chunk
-- Possible UNIQUE KEY column names in test.__oak_test_mi:
-- - id
-- Checking for UNIQUE columns on test.test_mi, by which to chunk
-- - Found following possible unique keys:
-- - id (mediumint)
-- Chosen unique key is 'id'
-- Shared columns: stuff, id
-- Created AD trigger
-- Created AU trigger
-- Created AI trigger
-- Attempting to lock tables

-- Tables locked WRITE
-- id (min, max) values: ([1L], [2L])
-- Tables unlocked
<type 'exceptions.Exception'> sequence item 0: expected string, long found
-- ERROR: Errors found. Initiating cleanup
-- Tables unlocked
-- Table test.__oak_test_mi was found and dropped
-- Dropped custom trigger test_mi_AD_oak
-- Dropped custom trigger test_mi_AU_oak
-- Dropped custom trigger test_mi_AI_oak
-- ERROR: sequence item 0: expected string, long found

Adding mediumint to the list of integer types checked in 
get_shared_unique_key_columns makes it work.

What version of the product are you using? On what operating system?
  - seen with v180, mysql 5.1.55, on rhel linux 4.8

Please provide any additional information below.

Original issue reported on code.google.com by megcroc...@gmail.com on 6 Apr 2011 at 10:38

GoogleCodeExporter commented 9 years ago
Fixed in rev 181.
Thank you for the detailed report.

Original comment by shlomi.n...@gmail.com on 7 Apr 2011 at 6:08