@@ -16523,73 +16523,6 @@ ha_innobase::store_lock(
16523
16523
m_prebuilt->stored_select_lock_type = LOCK_NONE;
16524
16524
}
16525
16525
16526
- if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK) {
16527
-
16528
- /* Starting from 5.0.7, we weaken also the table locks
16529
- set at the start of a MySQL stored procedure call, just like
16530
- we weaken the locks set at the start of an SQL statement.
16531
- MySQL does set in_lock_tables TRUE there, but in reality
16532
- we do not need table locks to make the execution of a
16533
- single transaction stored procedure call deterministic
16534
- (if it does not use a consistent read). */
16535
-
16536
- if (lock_type == TL_READ
16537
- && sql_command == SQLCOM_LOCK_TABLES) {
16538
- /* We come here if MySQL is processing LOCK TABLES
16539
- ... READ LOCAL. MyISAM under that table lock type
16540
- reads the table as it was at the time the lock was
16541
- granted (new inserts are allowed, but not seen by the
16542
- reader). To get a similar effect on an InnoDB table,
16543
- we must use LOCK TABLES ... READ. We convert the lock
16544
- type here, so that for InnoDB, READ LOCAL is
16545
- equivalent to READ. This will change the InnoDB
16546
- behavior in mysqldump, so that dumps of InnoDB tables
16547
- are consistent with dumps of MyISAM tables. */
16548
-
16549
- lock_type = TL_READ_NO_INSERT;
16550
- }
16551
-
16552
- /* If we are not doing a LOCK TABLE, DISCARD/IMPORT
16553
- TABLESPACE or TRUNCATE TABLE then allow multiple
16554
- writers. Note that ALTER TABLE uses a TL_WRITE_ALLOW_READ
16555
- < TL_WRITE_CONCURRENT_INSERT.
16556
-
16557
- We especially allow multiple writers if MySQL is at the
16558
- start of a stored procedure call (SQLCOM_CALL) or a
16559
- stored function call (MySQL does have in_lock_tables
16560
- TRUE there). */
16561
-
16562
- if ((lock_type >= TL_WRITE_CONCURRENT_INSERT
16563
- && lock_type <= TL_WRITE)
16564
- && !(in_lock_tables
16565
- && sql_command == SQLCOM_LOCK_TABLES)
16566
- && !thd_tablespace_op(thd)
16567
- && sql_command != SQLCOM_TRUNCATE
16568
- && sql_command != SQLCOM_OPTIMIZE
16569
- && sql_command != SQLCOM_CREATE_TABLE) {
16570
-
16571
- lock_type = TL_WRITE_ALLOW_WRITE;
16572
- }
16573
-
16574
- /* In queries of type INSERT INTO t1 SELECT ... FROM t2 ...
16575
- MySQL would use the lock TL_READ_NO_INSERT on t2, and that
16576
- would conflict with TL_WRITE_ALLOW_WRITE, blocking all inserts
16577
- to t2. Convert the lock to a normal read lock to allow
16578
- concurrent inserts to t2.
16579
-
16580
- We especially allow concurrent inserts if MySQL is at the
16581
- start of a stored procedure call (SQLCOM_CALL)
16582
- (MySQL does have thd_in_lock_tables() TRUE there). */
16583
-
16584
- if (lock_type == TL_READ_NO_INSERT
16585
- && sql_command != SQLCOM_LOCK_TABLES) {
16586
-
16587
- lock_type = TL_READ;
16588
- }
16589
-
16590
- lock.type = lock_type;
16591
- }
16592
-
16593
16526
if (!trx_is_started(trx)
16594
16527
&& (m_prebuilt->select_lock_type != LOCK_NONE
16595
16528
|| m_prebuilt->stored_select_lock_type != LOCK_NONE)) {
0 commit comments