I believe SET NAMES feature introduced recently could be easily improved.
As of now SET NAMES uses the SERVER DEFAULT for SET NAMES vith direct connection and SSH. With HTTP SET NAMES is implemented in the tunnelling file and it reads like
Code:
$query = ” SHOW variables like 'character_set_%' “;
$db_database = $dta['character_set_database'];
if( strlen($db_database)){
$query = “SET NAMES “.$db_database;
mysql_query ( $query, $mysql );
}
however
Code:
$query = ” SHOW variables like 'character_set_%' “;
$db_table = $dta['character_set_table'];
if(strlen($db_table)){
$query = “SET NAMES “.$db_table;
mysql_query ( $query, $mysql );
}
… seems to work fine. But not of much use as of now due to the 'Turkish' issue unfortunately!
But the idea is correct I think. Not only databases but also tables may have different charset defaults than the server. AND THAT SHOULD APPLY to the executables as well, so that same would have effect with direct/SSH. Each time a new table is selected a C-equivalent to latter PHP-example should be executed.
Ideally it should be on a per column basis as columns also may have different charsets. But I don't think it is practicable with a GUI tool. In situations where columns with different charset exist in a table it would be a workaround to split each SQL into two or more. Or split the table into more and create a VIEW using JOIN.