Skip to content

Commit

Permalink
Fix retrieval of get_post_table_characterset (#231)
Browse files Browse the repository at this point in the history
Query command run through `assoc_args_to_str` get double quotes truncated and fail to execute. 

Using single quotes in the query prevent error.

`Warning: Failed to get current character set of the posts table. Reason: ERROR at line 1: Unknown command '\_'`

Error may be more prominent on windows.
  • Loading branch information
lipemat authored Oct 28, 2022
1 parent c99bee5 commit 196f4d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/DB_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,8 @@ private function get_posts_table_charset( $assoc_args ) {
. 'FROM information_schema.`TABLES` T, '
. 'information_schema.`COLLATION_CHARACTER_SET_APPLICABILITY` CCSA '
. 'WHERE CCSA.collation_name = T.table_collation '
. 'AND T.table_schema = "' . DB_NAME . '" '
. 'AND T.table_name LIKE "%\_posts";';
. "AND T.table_schema = '" . DB_NAME . "' "
. "AND T.table_name LIKE '%\_posts';";

list( $stdout, $stderr, $exit_code ) = self::run(
sprintf(
Expand Down

0 comments on commit 196f4d3

Please sign in to comment.