Skip to content

Commit aed5928

Browse files
committed
cleanup: extract transaction-related part of handlerton
into a separate transaction_participant structure handlerton inherits it, so handlerton itself doesn't change. but entities that only need to participate in a transaction, like binlog or online alter log, use a transaction_participant and no longer need to pretend to be a full-blown but invisible storage engine which doesn't support create table.
1 parent 126d6d7 commit aed5928

32 files changed

+581
-635
lines changed

include/mysql/plugin.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ struct st_mysql_storage_engine
645645
int interface_version;
646646
};
647647

648-
struct handlerton;
648+
struct transaction_participant;
649649

650650

651651
/*
@@ -748,7 +748,7 @@ void mysql_query_cache_invalidate4(MYSQL_THD thd,
748748
/**
749749
Provide a handler data getter to simplify coding
750750
*/
751-
void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
751+
void *thd_get_ha_data(const MYSQL_THD thd, const struct transaction_participant *hton);
752752

753753

754754
/**
@@ -769,10 +769,10 @@ void *thd_get_ha_data(const MYSQL_THD thd, const struct handlerton *hton);
769769
thd_set_ha_data() in this connection before, storage engine
770770
plugin lock gets released.
771771
772-
If handlerton::close_connection() didn't reset ha_data, server does
773-
it immediately after calling handlerton::close_connection().
772+
If transaction_participant::close_connection() didn't reset ha_data, server
773+
does it immediately after calling transaction_participant::close_connection()
774774
*/
775-
void thd_set_ha_data(MYSQL_THD thd, const struct handlerton *hton,
775+
void thd_set_ha_data(MYSQL_THD thd, const struct transaction_participant *hton,
776776
const void *ha_data);
777777

778778

include/mysql/plugin_audit.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
{
644644
int interface_version;
645645
};
646-
struct handlerton;
646+
struct transaction_participant;
647647
struct Mysql_replication {
648648
int interface_version;
649649
};
@@ -671,8 +671,8 @@
671671
void mysql_query_cache_invalidate4(THD* thd,
672672
const char *key, unsigned int key_length,
673673
int using_trx);
674-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
675-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
674+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
675+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
676676
const void *ha_data);
677677
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
678678
}

include/mysql/plugin_auth.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
{
644644
int interface_version;
645645
};
646-
struct handlerton;
646+
struct transaction_participant;
647647
struct Mysql_replication {
648648
int interface_version;
649649
};
@@ -671,8 +671,8 @@
671671
void mysql_query_cache_invalidate4(THD* thd,
672672
const char *key, unsigned int key_length,
673673
int using_trx);
674-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
675-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
674+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
675+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
676676
const void *ha_data);
677677
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
678678
}

include/mysql/plugin_data_type.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
{
644644
int interface_version;
645645
};
646-
struct handlerton;
646+
struct transaction_participant;
647647
struct Mysql_replication {
648648
int interface_version;
649649
};
@@ -671,8 +671,8 @@
671671
void mysql_query_cache_invalidate4(THD* thd,
672672
const char *key, unsigned int key_length,
673673
int using_trx);
674-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
675-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
674+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
675+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
676676
const void *ha_data);
677677
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
678678
}

include/mysql/plugin_encryption.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
{
644644
int interface_version;
645645
};
646-
struct handlerton;
646+
struct transaction_participant;
647647
struct Mysql_replication {
648648
int interface_version;
649649
};
@@ -671,8 +671,8 @@
671671
void mysql_query_cache_invalidate4(THD* thd,
672672
const char *key, unsigned int key_length,
673673
int using_trx);
674-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
675-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
674+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
675+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
676676
const void *ha_data);
677677
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
678678
}

include/mysql/plugin_ftparser.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@
595595
{
596596
int interface_version;
597597
};
598-
struct handlerton;
598+
struct transaction_participant;
599599
struct Mysql_replication {
600600
int interface_version;
601601
};
@@ -623,8 +623,8 @@
623623
void mysql_query_cache_invalidate4(THD* thd,
624624
const char *key, unsigned int key_length,
625625
int using_trx);
626-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
627-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
626+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
627+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
628628
const void *ha_data);
629629
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
630630
}

include/mysql/plugin_function.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
{
644644
int interface_version;
645645
};
646-
struct handlerton;
646+
struct transaction_participant;
647647
struct Mysql_replication {
648648
int interface_version;
649649
};
@@ -671,8 +671,8 @@
671671
void mysql_query_cache_invalidate4(THD* thd,
672672
const char *key, unsigned int key_length,
673673
int using_trx);
674-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
675-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
674+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
675+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
676676
const void *ha_data);
677677
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
678678
}

include/mysql/plugin_password_validation.h.pp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@
643643
{
644644
int interface_version;
645645
};
646-
struct handlerton;
646+
struct transaction_participant;
647647
struct Mysql_replication {
648648
int interface_version;
649649
};
@@ -671,8 +671,8 @@
671671
void mysql_query_cache_invalidate4(THD* thd,
672672
const char *key, unsigned int key_length,
673673
int using_trx);
674-
void *thd_get_ha_data(const THD* thd, const struct handlerton *hton);
675-
void thd_set_ha_data(THD* thd, const struct handlerton *hton,
674+
void *thd_get_ha_data(const THD* thd, const struct transaction_participant *hton);
675+
void thd_set_ha_data(THD* thd, const struct transaction_participant *hton,
676676
const void *ha_data);
677677
void thd_wakeup_subsequent_commits(THD* thd, int wakeup_error);
678678
}

0 commit comments

Comments
 (0)