[Commits] Rev 4496: Remove some redundant code, found during MDEV-6676 development. in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Thu Nov 13 16:09:23 EET 2014


At http://bazaar.launchpad.net/~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4496
revision-id: knielsen at knielsen-hq.org-20140916080907-p8tut0vvx0vg2kcl
parent: knielsen at knielsen-hq.org-20140916080732-50roqwrx42aycshe
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0-mdev6676
timestamp: Tue 2014-09-16 10:09:07 +0200
message:
  Remove some redundant code, found during MDEV-6676 development.
=== modified file 'sql/sys_vars.cc'
--- a/sql/sys_vars.cc	2014-09-16 08:07:32 +0000
+++ b/sql/sys_vars.cc	2014-09-16 08:09:07 +0000
@@ -2989,12 +2989,6 @@ static const char *old_mode_names[]=
   0
 };
 
-export bool old_mode_string_representation(THD *thd, ulonglong sql_mode,
-                                           LEX_STRING *ls)
-{
-  set_to_string(thd, ls, sql_mode, old_mode_names);
-  return ls->str == 0;
-}
 /*
   sql_mode should *not* be IN_BINLOG as the slave can't remember this
   anyway on restart.

=== modified file 'storage/xtradb/handler/ha_innodb.cc'
--- a/storage/xtradb/handler/ha_innodb.cc	2014-11-13 11:24:26 +0000
+++ b/storage/xtradb/handler/ha_innodb.cc	2014-09-16 08:09:07 +0000
@@ -1187,24 +1187,6 @@ innobase_start_trx_and_assign_read_view(
         THD*            thd);           /* in: MySQL thread handle of the
                                         user for whom the transaction should
                                         be committed */
-#ifdef NOT_USED
-/*****************************************************************//**
-Creates an InnoDB transaction struct for the thd if it does not yet have one.
-Starts a new InnoDB transaction if a transaction is not yet started. And
-clones snapshot for a consistent read from another session, if it has one.
- at return 0 */
-static
-int
-innobase_start_trx_and_clone_read_view(
-/*====================================*/
-        handlerton*     hton,           /* in: Innodb handlerton */
-        THD*            thd,            /* in: MySQL thread handle of the
-                                        user for whom the transaction should
-                                        be committed */
-        THD*            from_thd);      /* in: MySQL thread handle of the
-                                        user session from which the consistent
-                                        read should be cloned */
-#endif
 /****************************************************************//**
 Flushes InnoDB logs to disk and makes a checkpoint. Really, a commit flushes
 the logs, and the name of this function should be innobase_checkpoint.
@@ -4137,104 +4119,6 @@ innobase_commit_ordered(
         DBUG_VOID_RETURN;
 }
 
-#ifdef NOT_USED
-/*****************************************************************//**
-Creates an InnoDB transaction struct for the thd if it does not yet have one.
-Starts a new InnoDB transaction if a transaction is not yet started. And
-clones snapshot for a consistent read from another session, if it has one.
- at return 0 */
-static
-int
-innobase_start_trx_and_clone_read_view(
-/*====================================*/
-        handlerton*     hton,           /* in: Innodb handlerton */
-        THD*            thd,            /* in: MySQL thread handle of the
-                                        user for whom the transaction should
-                                        be committed */
-        THD*            from_thd)       /* in: MySQL thread handle of the
-                                        user session from which the consistent
-                                        read should be cloned */
-{
-        trx_t*  trx;
-        trx_t*  from_trx;
-
-        DBUG_ENTER("innobase_start_trx_and_clone_read_view");
-        DBUG_ASSERT(hton == innodb_hton_ptr);
-
-        /* Get transaction handle from the donor session */
-
-        from_trx = thd_to_trx(from_thd);
-
-        if (!from_trx) {
-                push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
-                                    HA_ERR_UNSUPPORTED,
-                                    "InnoDB: WITH CONSISTENT SNAPSHOT "
-                                    "FROM SESSION was ignored because the "
-                                    "specified session does not have an open "
-                                    "transaction inside InnoDB.");
-
-                DBUG_RETURN(0);
-        }
-
-        /* Create a new trx struct for thd, if it does not yet have one */
-
-        trx = check_trx_exists(thd);
-
-        /* This is just to play safe: release a possible FIFO ticket and
-        search latch. Since we can potentially reserve the trx_sys->mutex,
-        we have to release the search system latch first to obey the latching
-        order. */
-
-        trx_search_latch_release_if_reserved(trx);
-
-        innobase_srv_conc_force_exit_innodb(trx);
-
-        /* If the transaction is not started yet, start it */
-
-        trx_start_if_not_started_xa(trx);
-
-        /* Clone the read view from the donor transaction.  Do this only if
-        transaction is using REPEATABLE READ isolation level. */
-        trx->isolation_level = innobase_map_isolation_level(
-                thd_get_trx_isolation(thd));
-
-        if (trx->isolation_level != TRX_ISO_REPEATABLE_READ) {
-
-                push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
-                                    HA_ERR_UNSUPPORTED,
-                                    "InnoDB: WITH CONSISTENT SNAPSHOT "
-                                    "was ignored because this phrase "
-                                    "can only be used with "
-                                    "REPEATABLE READ isolation level.");
-        } else {
-
-                lock_mutex_enter();
-                mutex_enter(&trx_sys->mutex);
-                trx_mutex_enter(from_trx);
-
-                if (!trx_clone_read_view(trx, from_trx)) {
-
-                        push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
-                                            HA_ERR_UNSUPPORTED,
-                                            "InnoDB: WITH CONSISTENT SNAPSHOT "
-                                            "FROM SESSION was ignored because "
-                                            "the target transaction has not been "
-                                            "assigned a read view.");
-                }
-
-                trx_mutex_exit(from_trx);
-                mutex_exit(&trx_sys->mutex);
-                lock_mutex_exit();
-        }
-
-        /* Set the MySQL flag to mark that there is an active transaction */
-
-        innobase_register_trx(hton, current_thd, trx);
-
-        DBUG_RETURN(0);
-}
-#endif
-
 /*****************************************************************//**
 Commits a transaction in an InnoDB database or marks an SQL statement
 ended.



More information about the commits mailing list