Skip to content

Commit c6ea57e

Browse files
committed
Bug #11762644 MYSQLSLAP OPTION --AUTO-GENERATE-SQL-SECONDARY-INDEXES
DOESNT WORK Applied a contribution from tsubasa tanaka Renamed the source to CC to get better warnings etc. Test case extended
1 parent c44c1f5 commit c6ea57e

4 files changed

Lines changed: 23 additions & 4 deletions

File tree

client/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient binlogevents_static)
8383
MYSQL_ADD_EXECUTABLE(mysqladmin mysqladmin.cc)
8484
TARGET_LINK_LIBRARIES(mysqladmin mysqlclient)
8585

86-
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.c)
87-
SET_SOURCE_FILES_PROPERTIES(mysqlslap.c PROPERTIES COMPILE_FLAGS "-DTHREADS")
86+
MYSQL_ADD_EXECUTABLE(mysqlslap mysqlslap.cc)
87+
SET_SOURCE_FILES_PROPERTIES(mysqlslap.cc PROPERTIES COMPILE_FLAGS "-DTHREADS")
8888
TARGET_LINK_LIBRARIES(mysqlslap mysqlclient)
8989

9090
MYSQL_ADD_EXECUTABLE(mysql_config_editor mysql_config_editor.cc)
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ build_table_string(void)
863863

864864
if (auto_generate_sql_guid_primary)
865865
{
866-
dynstr_append(&table_string, "id varchar(32) primary key");
866+
dynstr_append(&table_string, "id varchar(36) primary key");
867867

868868
if (num_int_cols || num_char_cols || auto_generate_sql_guid_primary)
869869
dynstr_append(&table_string, ",");
@@ -878,7 +878,7 @@ build_table_string(void)
878878
if (count) /* Except for the first pass we add a comma */
879879
dynstr_append(&table_string, ",");
880880

881-
if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(32) unique key", count)
881+
if (snprintf(buf, HUGE_STRING_LENGTH, "id%d varchar(36) unique key", count)
882882
> HUGE_STRING_LENGTH)
883883
{
884884
fprintf(stderr, "Memory Allocation error in create table\n");

mysql-test/r/mysqlslap.result

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,3 +263,9 @@ mysqlslap: [Warning] option 'iterations': unsigned value 0 adjusted to 1
263263
#WL7764 : Make STRICT mode for transactional SEs default in 5.7
264264
#Adding negative test for added option --sql_mode
265265
End of tests
266+
#
267+
# Bug #11762644: MYSQLSLAP OPTION --AUTO-GENERATE-SQL-SECONDARY-INDEXES DOESNT WORK
268+
#
269+
#
270+
# End of 5.7 tests
271+
#

mysql-test/t/mysqlslap.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,16 @@ DROP DATABASE bug58090;
9191
--error 1
9292
--exec $MYSQL_SLAP -uroot --password="" --sql_mode='abc'
9393
--echo End of tests
94+
95+
--echo #
96+
--echo # Bug #11762644: MYSQLSLAP OPTION --AUTO-GENERATE-SQL-SECONDARY-INDEXES DOESNT WORK
97+
--echo #
98+
99+
--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-guid-primary --create-schema=slap
100+
101+
--exec $MYSQL_SLAP --concurrency=1 --silent --iterations=1 --number-int-cols=2 --number-char-cols=3 --auto-generate-sql --auto-generate-sql-secondary-indexes=1 --create-schema=slap
102+
103+
104+
--echo #
105+
--echo # End of 5.7 tests
106+
--echo #

0 commit comments

Comments
 (0)