[wp-trac] [WordPress Trac] #38921: Defining filter pre_get_table_charset causes errors
WordPress Trac
noreply at wordpress.org
Sun Mar 18 10:24:29 UTC 2018
#38921: Defining filter pre_get_table_charset causes errors
--------------------------------------+-----------------------------
Reporter: haoran | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future Release
Component: Database | Version: 4.2
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests | Focuses:
--------------------------------------+-----------------------------
Changes (by birgire):
* keywords: needs-patch => has-patch has-unit-tests
Comment:
In [attachment:38921.diff] there's a suggestion how to set
{{{$this->table_charset}}}, when the the table charset is short-curcuited
with the {{{pre_get_table_charset}}} filter.
There's an existing test for the {{{wpdb::get_table_charset()}}} method,
with the {{{pre_get_table_charset}}} filter, in
[https://core.trac.wordpress.org/browser/tags/4.9/tests/phpunit/tests/db.php#L916
(Source)]:
{{{
Tests_DB::test_pre_get_table_charset_filter()
}}}
but it doesn't test it with the {{{wpdb::get_col_charset()}}} method as
well.
[attachment:38921.diff] extends that test with a new one in:
{{{
Tests_DB_Charset::test_get_table_and_column_charset_with_pre_get_table_charset_filter()
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/38921#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list