| 133 | } |
| 134 | |
| 135 | void MaterializeMetadata::fetchMasterVariablesValue(const mysqlxx::PoolWithFailover::Entry & connection) |
| 136 | { |
| 137 | Block variables_header{ |
| 138 | {std::make_shared<DataTypeString>(), "Variable_name"}, |
| 139 | {std::make_shared<DataTypeString>(), "Value"} |
| 140 | }; |
| 141 | |
| 142 | const String & fetch_query = "SHOW VARIABLES WHERE Variable_name = 'binlog_checksum'"; |
| 143 | StreamSettings mysql_input_stream_settings(settings, false, true); |
| 144 | MySQLBlockInputStream variables_input(connection, fetch_query, variables_header, mysql_input_stream_settings); |
| 145 | |
| 146 | while (Block variables_block = variables_input.read()) |
| 147 | { |
| 148 | ColumnPtr variables_name = variables_block.getByName("Variable_name").column; |
| 149 | ColumnPtr variables_value = variables_block.getByName("Value").column; |
| 150 | |
| 151 | for (size_t index = 0; index < variables_block.rows(); ++index) |
| 152 | { |
| 153 | if (variables_name->getDataAt(index) == "binlog_checksum") |
| 154 | binlog_checksum = variables_value->getDataAt(index).toString(); |
| 155 | } |
| 156 | } |
| 157 | } |
| 158 | |
| 159 | static bool checkSyncUserPrivImpl(const mysqlxx::PoolWithFailover::Entry & connection, const Settings & global_settings, WriteBuffer & out) |
| 160 | { |