~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/innobase/handler/ha_innodb.cc

Merge Revision revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6790 from MySQL InnoDB

Original revid:svn-v4:16c675df-0fcb-4bc9-8058-dcc011a37293:branches/zip:6790

Original Authors: jyang
Original commit message:
branches/zip: Fix bug #51356: "many valgrind errors in error messages
with concurrent ddl". Null terminate the name string returned
from innobase_convert_identifier() call when reporting DB_DUPLICATE_KEY
error in create_table_def().
rb://266 approved by Marko

Show diffs side-by-side

added added

removed removed

Lines of Context:
5707
5707
 
5708
5708
        if (error == DB_DUPLICATE_KEY) {
5709
5709
                char buf[100];
5710
 
                innobase_convert_identifier(buf, sizeof buf,
5711
 
                                            table_name, strlen(table_name),
5712
 
                                            trx->mysql_thd, TRUE);
 
5710
                char* buf_end = innobase_convert_identifier(
 
5711
                        buf, sizeof buf - 1, table_name, strlen(table_name),
 
5712
                        trx->mysql_thd, TRUE);
 
5713
 
 
5714
                *buf_end = '\0';
5713
5715
                my_error(ER_TABLE_EXISTS_ERROR, MYF(0), buf);
5714
5716
        }
5715
5717