~clint-fewbar/ubuntu/natty/mysql-5.1/merge-5.1.49-2

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-08-04 13:18:27 UTC
  • mfrom: (1.2.2 upstream) (2.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20100804131827-4tjg88vr9dd49s3k
Tags: 5.1.49-1ubuntu1
* Merge from debian unstable:
  + debian/control:
     * Update maintainer according to spec.
     * Move section from "misc" to "database".
     * Added libmysqlclient16-dev an empty transitional package. 
     * Added mysql-client-core-5.1 package.
     * Suggest mailx for mysql-server-5.1
     * Add mysql-testsuite package so you can run the testsuite seperately.
  + debian/additions/my.cnf:
    * Remove language options. Error message files are located in a different directory in Mysql
      5.0. Setting the language option to use /usr/share/mysql/english breaks Mysql 5.0. Both 5.0
      and 5.1 use a different value that works. (LP: #316974)
  + Add apparmor profile:
    + debian/apparmor-profile: apparmor-profile
    + debian/rules, debian/mysql-server-5.1.files: install apparmor profile
    + debian/mysql-server-5.1.dirs: add etc/apparmor.d/fore-complain
    + debian/mysql-server-5.1.postrm: remove symlink in force-complain/ on purge.
    + debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    + debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    + debian/mysql-server-5.1.postinst: reload apparmor profiles
  * Convert the package from sysvinit to upstart:
    + debian/mysql-server-5.1.mysql.upstart: Add upstart script.
    + debian/mysql-server-5.1.mysql.init: Dropped, unused now with upstart.
    + debian/additions/mysqld_safe_syslog.cnf: Dropped, unused now with upstart.
    + debian/additons/my.cnf: Remove pid declaration and setup error logging to /var/log/mysql since
      we're not piping anything around logger anymore.
    + debian/rules, debian/mysql-server-5.1.logcheck.ignore.{paranoid,worstation},
      debian/mysql-server-5.1.logcheck.ignore.server: : Remove references to mysqld_safe
    + debian/patches/38_scripts_mysqld_safe.sh_signals.dpatch: Dropped
  * Added -fno-strict-aliasing to CFLAGS to get around mysql testsuite build failures.
  * Add Apport hook (LP: #354188):
    + debian/mysql-server-5.1.py: apport package hook
    + debian/rules: Make it installable
  * debian/mysql-server-5.1.mysql-server.logrotate: Check to see if mysql is running before
    running logrotate. (LP: #513135)
  * Make the testsuite installable. (LP: #530752)
    + debian/mysql-server-5.1.files, debian/rules: install apport package hook
  * debian/mysql-server-5.1.preinst: Set mysql user's home directory
    to /nonexistent to protect against having the /var/lib/mysql
    user-writeable. If an attacker can trick mysqld into creating
    dot files in the home directory, he could do .rhost-like attacks
    on the system. (LP: #293258)
  * debian/control: mysql-client-5.1 should depend on mysql-core-client-5.1.
    (LP: #590952) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
583
583
/************************************************************************
584
584
Obtain the InnoDB transaction of a MySQL thread. */
585
585
inline
586
 
trx_t*&
 
586
trx_t*
587
587
thd_to_trx(
588
588
/*=======*/
589
589
                        /* out: reference to transaction pointer */
590
590
        THD*    thd)    /* in: MySQL thread */
591
591
{
592
 
        return(*(trx_t**) thd_ha_data(thd, innodb_hton_ptr));
 
592
        return((trx_t*) thd_get_ha_data(thd, innodb_hton_ptr));
593
593
}
594
594
 
595
595
/************************************************************************
1164
1164
                        /* out: InnoDB transaction handle */
1165
1165
        THD*    thd)    /* in: user thread handle */
1166
1166
{
1167
 
        trx_t*& trx = thd_to_trx(thd);
 
1167
        trx_t*  trx = thd_to_trx(thd);
1168
1168
 
1169
1169
        ut_ad(thd == current_thd);
1170
1170
 
1178
1178
                /* Update the info whether we should skip XA steps that eat
1179
1179
                CPU time */
1180
1180
                trx->support_xa = THDVAR(thd, support_xa);
 
1181
 
 
1182
                /* We have a new trx, register with the thread handle */
 
1183
                thd_set_ha_data(thd, innodb_hton_ptr, trx);
1181
1184
        } else {
1182
1185
                if (trx->magic_n != TRX_MAGIC_N) {
1183
1186
                        mem_analyze_corruption(trx);
2482
2485
 
2483
2486
        innobase_rollback_trx(trx);
2484
2487
 
 
2488
        /* Release the lock in thread handler */
 
2489
        thd_set_ha_data(thd, hton, NULL);
 
2490
 
2485
2491
        thr_local_free(trx->mysql_thread_id);
2486
2492
        trx_free_for_mysql(trx);
2487
2493
 
3236
3242
        case MYSQL_TYPE_BLOB:
3237
3243
        case MYSQL_TYPE_LONG_BLOB:
3238
3244
                return(DATA_BLOB);
 
3245
        case MYSQL_TYPE_NULL:
 
3246
                /* MySQL currently accepts "NULL" datatype, but will
 
3247
                reject such datatype in the next release. We will cope
 
3248
                with it and not trigger assertion failure in 5.1 */
 
3249
                break;
3239
3250
        default:
3240
3251
                assert(0);
3241
3252
        }
5257
5268
                field = form->field[i];
5258
5269
 
5259
5270
                col_type = get_innobase_type_from_mysql_type(&unsigned_type,
5260
 
                                                                        field);
 
5271
                                                             field);
 
5272
 
 
5273
                if (!col_type) {
 
5274
                        push_warning_printf(
 
5275
                                (THD*) trx->mysql_thd,
 
5276
                                MYSQL_ERROR::WARN_LEVEL_WARN,
 
5277
                                ER_CANT_CREATE_TABLE,
 
5278
                                "Error creating table '%s' with "
 
5279
                                "column '%s'. Please check its "
 
5280
                                "column type and try to re-create "
 
5281
                                "the table with an appropriate "
 
5282
                                "column type.",
 
5283
                                table->name, (char*) field->field_name);
 
5284
                        goto err_col;
 
5285
                }
 
5286
 
5261
5287
                if (field->null_ptr) {
5262
5288
                        nulls_allowed = 0;
5263
5289
                } else {
5314
5340
                                "different column name.",
5315
5341
                                table->name, (char*) field->field_name,
5316
5342
                                (char*) field->field_name);
5317
 
 
 
5343
err_col:
5318
5344
                        dict_mem_table_free(table);
5319
5345
                        trx_commit_for_mysql(trx);
5320
5346