~ubuntu-branches/ubuntu/quantal/mysql-5.5/quantal-security

« back to all changes in this revision

Viewing changes to storage/innobase/dict/dict0crea.c

  • Committer: Package Import Robot
  • Author(s): Seth Arnold
  • Date: 2013-04-18 18:15:39 UTC
  • mfrom: (1.1.12)
  • Revision ID: package-import@ubuntu.com-20130418181539-7uo1w041b4h2ulbs
Tags: 5.5.31-0ubuntu0.12.10.1
* SECURITY UPDATE: Update to 5.5.31 to fix security issues (LP: #1170516)
  - http://www.oracle.com/technetwork/topics/security/cpuapr2013-1899555.html
* debian/patches/71_disable_rpl_tests.patch: refreshed.
* debian/patches/fix-mysqldump-test.patch: removed, fixed differently
  upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include "trx0roll.h"
43
43
#include "usr0sess.h"
44
44
#include "ut0vec.h"
 
45
#include "ha_prototypes.h"
45
46
 
46
47
/*****************************************************************//**
47
48
Based on a table object, this function builds the entry to be inserted
1427
1428
        pars_info_t*    info = pars_info_create();
1428
1429
 
1429
1430
        if (foreign->id == NULL) {
 
1431
                char*   stripped_name;
1430
1432
                /* Generate a new constraint id */
1431
1433
                ulint   namelen = strlen(table->name);
1432
1434
                char*   id      = mem_heap_alloc(foreign->heap, namelen + 20);
1433
1435
                /* no overflow if number < 1e13 */
1434
1436
                sprintf(id, "%s_ibfk_%lu", table->name, (ulong) (*id_nr)++);
1435
1437
                foreign->id = id;
 
1438
 
 
1439
                stripped_name = strchr(foreign->id, '/') + 1;
 
1440
                if (innobase_check_identifier_length(stripped_name)) {
 
1441
                        fprintf(stderr, "InnoDB: Generated foreign key "
 
1442
                                "name (%s) is too long\n", foreign->id);
 
1443
                        return(DB_IDENTIFIER_TOO_LONG);
 
1444
                }
1436
1445
        }
1437
1446
 
1438
1447
        pars_info_add_str_literal(info, "id", foreign->id);