Class MySqlConnection

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MySqlConnection.MySqlConnectionConfiguration
      Connection configuration to create a MySqlConnection.
      • Nested classes/interfaces inherited from class io.debezium.jdbc.JdbcConnection

        io.debezium.jdbc.JdbcConnection.BlockingMultiResultSetConsumer, io.debezium.jdbc.JdbcConnection.BlockingResultSetConsumer, io.debezium.jdbc.JdbcConnection.CallPreparer, io.debezium.jdbc.JdbcConnection.ConnectionFactory, io.debezium.jdbc.JdbcConnection.MultiResultSetConsumer, io.debezium.jdbc.JdbcConnection.Operations, io.debezium.jdbc.JdbcConnection.ParameterResultSetConsumer, io.debezium.jdbc.JdbcConnection.ResultSetConsumer, io.debezium.jdbc.JdbcConnection.ResultSetExtractor<T extends Object>, io.debezium.jdbc.JdbcConnection.ResultSetMapper<T extends Object>, io.debezium.jdbc.JdbcConnection.StatementFactory, io.debezium.jdbc.JdbcConnection.StatementPreparer
    • Method Detail

      • readMySqlCharsetSystemVariables

        protected Map<String,​String> readMySqlCharsetSystemVariables()
        Read the MySQL charset-related system variables.
        Returns:
        the system variables that are related to server character sets; never null
      • readMySqlSystemVariables

        protected Map<String,​String> readMySqlSystemVariables()
        Read the MySQL system variables.
        Returns:
        the system variables that are related to server character sets; never null
      • setSystemProperty

        protected void setSystemProperty​(String property,
                                         io.debezium.config.Field field,
                                         boolean showValueInError)
      • getSessionVariableForSslVersion

        protected String getSessionVariableForSslVersion()
        Read the Ssl Version session variable.
        Returns:
        the session variables that are related to sessions ssl version
      • isGtidModeEnabled

        public boolean isGtidModeEnabled()
        Determine whether the MySQL server has GTIDs enabled.
        Returns:
        false if the server's gtid_mode is set and is OFF, or true otherwise
      • knownGtidSet

        public String knownGtidSet()
        Determine the executed GTID set for MySQL.
        Returns:
        the string representation of MySQL's GTID sets; never null but an empty string if the server does not use GTIDs
      • subtractGtidSet

        public io.debezium.connector.mysql.GtidSet subtractGtidSet​(io.debezium.connector.mysql.GtidSet set1,
                                                                   io.debezium.connector.mysql.GtidSet set2)
        Determine the difference between two sets.
        Returns:
        a subtraction of two GTID sets; never null
      • purgedGtidSet

        public io.debezium.connector.mysql.GtidSet purgedGtidSet()
        Get the purged GTID values from MySQL (gtid_purged value).
        Returns:
        A GTID set; may be empty if not using GTIDs or none have been purged yet
      • userHasPrivileges

        public boolean userHasPrivileges​(String grantName)
        Determine if the current user has the named privilege. Note that if the user has the "ALL" privilege this method returns true.
        Parameters:
        grantName - the name of the MySQL privilege; may not be null
        Returns:
        true if the user has the named privilege, or false otherwise
      • earliestBinlogFilename

        public String earliestBinlogFilename()
        Determine the earliest binlog filename that is still available in the server.
        Returns:
        the name of the earliest binlog filename, or null if there are none.
      • isBinlogRowImageFull

        protected boolean isBinlogRowImageFull()
        Determine whether the MySQL server has the binlog_row_image set to 'FULL'.
        Returns:
        true if the server's binlog_row_image is set to FULL, or false otherwise
      • isBinlogFormatRow

        protected boolean isBinlogFormatRow()
        Determine whether the MySQL server has the row-level binlog enabled.
        Returns:
        true if the server's binlog_format is set to ROW, or false otherwise
      • availableBinlogFiles

        public List<String> availableBinlogFiles()
        Query the database server to get the list of the binlog files availble.
        Returns:
        list of the binlog files
      • getEstimatedTableSize

        public OptionalLong getEstimatedTableSize​(io.debezium.relational.TableId tableId)
      • isTableIdCaseSensitive

        public boolean isTableIdCaseSensitive()
      • readDatabaseCollations

        protected Map<String,​io.debezium.connector.mysql.legacy.MySqlJdbcContext.DatabaseLocales> readDatabaseCollations()
        Read the MySQL default character sets for exisiting databases.
        Returns:
        the map of database names with their default character sets; never null
      • connectionString

        public String connectionString()
      • getJavaEncodingForMysqlCharSet

        public static String getJavaEncodingForMysqlCharSet​(String mysqlCharsetName)
      • getColumnValue

        public <T extends io.debezium.schema.DatabaseSchema<io.debezium.relational.TableId>> Object getColumnValue​(ResultSet rs,
                                                                                                                   int columnIndex,
                                                                                                                   io.debezium.relational.Column column,
                                                                                                                   io.debezium.relational.Table table,
                                                                                                                   T schema)
                                                                                                            throws SQLException
        Overrides:
        getColumnValue in class io.debezium.jdbc.JdbcConnection
        Throws:
        SQLException
      • quotedTableIdString

        public String quotedTableIdString​(io.debezium.relational.TableId tableId)
        Overrides:
        quotedTableIdString in class io.debezium.jdbc.JdbcConnection
      • getShowBinaryLogStatement

        public String getShowBinaryLogStatement()