You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Queries to information_schema appear to succeed without errors, but they may not be returning correct results. I found out that there seems to be some rewriting done, but my guess is it may only be handling a few cases.
Checking for whether a table, column, or an index exist seems to return wrong result.
Here are the failing test cases:
publicfunctiontestTableExists() {
$this->assertQuery( 'CREATE TABLE test (id INT)' );
$return = $this->assertQuery( "SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 'test'" );
$this->assertEquals( [(object) ["1" => "1"]], $return );
}
publicfunctiontestColumnExists() {
$this->assertQuery( 'CREATE TABLE test (id INT)' );
$return = $this->assertQuery( "SELECT 1 FROM information_schema.columns WHERE table_schema = DATABASE() AND table_name = 'test' AND column_name = 'id'" );
$this->assertEquals( [(object) ["1" => "1"]], $return );
}
publicfunctiontestIndexExists() {
$this->assertQuery( 'CREATE TABLE test (id INT)' );
$this->assertQuery( 'ALTER TABLE test ADD INDEX test_id_idx (id)' );
$return = $this->assertQuery( "SELECT 1 FROM information_schema.statistics WHERE table_schema = DATABASE() AND table_name = 'test' AND index_name = 'test_id_idx'" );
$this->assertEquals( [(object) ["1" => "1"]], $return );
}
What is the status of information_schema support? Is it technically possible to rewrite all kinds of information schema queries, or would an easier approach be to create and manage the tables?
The text was updated successfully, but these errors were encountered:
Queries to
information_schema
appear to succeed without errors, but they may not be returning correct results. I found out that there seems to be some rewriting done, but my guess is it may only be handling a few cases.Checking for whether a table, column, or an index exist seems to return wrong result.
Here are the failing test cases:
What is the status of
information_schema
support? Is it technically possible to rewrite all kinds of information schema queries, or would an easier approach be to create and manage the tables?The text was updated successfully, but these errors were encountered: