We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f77f6ff commit 38a7476Copy full SHA for 38a7476
packages/wp-mysql-proxy/src/class-mysql-session.php
@@ -251,6 +251,17 @@ private function process_authentication( string $payload ): string {
251
// Get the database name.
252
if ( $client_flags & MySQL_Protocol::CLIENT_CONNECT_WITH_DB ) {
253
$database = MySQL_Protocol::read_null_terminated_string( $payload, $offset );
254
+ if ( '' !== $database ) {
255
+ $result = $this->adapter->handle_query( 'USE ' . $database );
256
+ if ( $result->error_info ) {
257
+ return MySQL_Protocol::build_err_packet(
258
+ $this->packet_id++,
259
+ 1049,
260
+ '42000',
261
+ sprintf( "Unknown database: '%s'", $database )
262
+ );
263
+ }
264
265
}
266
267
// Get the authentication plugin name.
0 commit comments