(
self, connection: Connection, setting_name: str
)
| 3651 | return parser.parse(sql, charset) |
| 3652 | |
| 3653 | def _fetch_setting( |
| 3654 | self, connection: Connection, setting_name: str |
| 3655 | ) -> Optional[str]: |
| 3656 | charset = self._connection_charset |
| 3657 | |
| 3658 | if self.server_version_info and self.server_version_info < (5, 6): |
| 3659 | sql = "SHOW VARIABLES LIKE '%s'" % setting_name |
| 3660 | fetch_col = 1 |
| 3661 | else: |
| 3662 | sql = "SELECT @@%s" % setting_name |
| 3663 | fetch_col = 0 |
| 3664 | |
| 3665 | show_var = connection.exec_driver_sql(sql) |
| 3666 | row = self._compat_first(show_var, charset=charset) |
| 3667 | if not row: |
| 3668 | return None |
| 3669 | else: |
| 3670 | return cast(Optional[str], row[fetch_col]) |
| 3671 | |
| 3672 | def _detect_charset(self, connection: Connection) -> str: |
| 3673 | raise NotImplementedError() |
no test coverage detected