(
self, connection: Connection, setting_name: str
)
| 3707 | return parser.parse(sql, charset) |
| 3708 | |
| 3709 | def _fetch_setting( |
| 3710 | self, connection: Connection, setting_name: str |
| 3711 | ) -> Optional[str]: |
| 3712 | charset = self._connection_charset |
| 3713 | |
| 3714 | if self.server_version_info and self.server_version_info < (5, 6): |
| 3715 | sql = "SHOW VARIABLES LIKE '%s'" % setting_name |
| 3716 | fetch_col = 1 |
| 3717 | else: |
| 3718 | sql = "SELECT @@%s" % setting_name |
| 3719 | fetch_col = 0 |
| 3720 | |
| 3721 | show_var = connection.exec_driver_sql(sql) |
| 3722 | row = self._compat_first(show_var, charset=charset) |
| 3723 | if not row: |
| 3724 | return None |
| 3725 | else: |
| 3726 | return cast(Optional[str], row[fetch_col]) |
| 3727 | |
| 3728 | def _detect_charset(self, connection: Connection) -> str: |
| 3729 | raise NotImplementedError() |
no test coverage detected