Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ if ( ! ( $parser_ast instanceof WP_MySQL_Native_Parser_Node ) ) {
wp_sqlite_native_parser_verification_fail( 'Native parser did not produce a native-backed AST in the WordPress PHP test container.' );
}

$driver = new WP_PDO_MySQL_On_SQLite( 'mysql-on-sqlite:path=:memory:;dbname=wp;' );
$driver = new WP_MySQL_On_SQLite( 'mysql-on-sqlite:path=:memory:;dbname=wp;' );
$parser = $driver->create_parser( 'SELECT 1' );
wp_sqlite_assert_native_parser_delegate( $parser, 'WordPress PHP test container SQLite driver did not create a native parser delegate.' );
$parser->next_query();
Expand Down
5 changes: 2 additions & 3 deletions packages/mysql-on-sqlite/src/load.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
define( 'WP_MYSQL_ON_SQLITE_LOADER_PATH', __FILE__ );

/**
* Load the PDO MySQL-on-SQLite driver and its dependencies.
* Load the MySQL-on-SQLite driver and its dependencies.
*/
require_once __DIR__ . '/php-polyfills.php';
require_once __DIR__ . '/version.php';
Expand Down Expand Up @@ -35,11 +35,10 @@
}
require_once __DIR__ . '/sqlite/class-wp-sqlite-connection.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-configurator.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-driver.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-driver-exception.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-information-schema-builder.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-information-schema-exception.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-information-schema-reconstructor.php';
require_once __DIR__ . '/sqlite/class-wp-sqlite-pdo-user-defined-functions.php';
require_once __DIR__ . '/sqlite/class-wp-pdo-mysql-on-sqlite.php';
require_once __DIR__ . '/sqlite/class-wp-mysql-on-sqlite.php';
require_once __DIR__ . '/sqlite/class-wp-pdo-proxy-statement.php';
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
*
* The driver requires PDO with the SQLite driver, and the PCRE engine.
*/
class WP_PDO_MySQL_On_SQLite extends PDO {
class WP_MySQL_On_SQLite extends PDO {
/**
* The path to the MySQL SQL grammar file.
*/
Expand Down Expand Up @@ -4211,7 +4211,7 @@ private function translate_query_expression( WP_Parser_Node $node ): string {
* When the ORDER BY clause is present, we need to disambiguate the item
* list and make sure they don't cause an "ambiguous column name" error.
*
* @see WP_SQLite_Driver::disambiguate_item()
* @see WP_MySQL_On_SQLite::disambiguate_item()
*/
$disambiguated_order_list = array();
$order_clause = $node->get_first_child_node( 'orderClause' );
Expand Down Expand Up @@ -4279,7 +4279,7 @@ private function translate_query_specification( WP_Parser_Node $node ): string {
* When the GROUP BY or HAVING clause is present, we need to disambiguate
* the items to ensure they don't cause an "ambiguous column name" error.
*
* @see WP_SQLite_Driver::disambiguate_item()
* @see WP_MySQL_On_SQLite::disambiguate_item()
*/
$group_by_clause = null;
$having_clause = null;
Expand Down Expand Up @@ -5767,7 +5767,7 @@ private function unnest_parenthesized_expression( WP_Parser_Node $node ): WP_Par
* consider column references in forms like "db.table.column".
*
* @param array $disambiguation_map The SELECT item disambiguation map (column name => array of select items).
* @see WP_SQLite_Driver::create_select_item_disambiguation_map()
* @see WP_MySQL_On_SQLite::create_select_item_disambiguation_map()
* @param WP_Parser_Node $expr The expression AST node or subnode.
* @return string|null The disambiguated and translated expression;
* null when the expression cannot be disambiguated.
Expand Down Expand Up @@ -5806,7 +5806,7 @@ private function disambiguate_item( array $disambiguation_map, WP_Parser_Node $e
* Create a SELECT item disambiguation map from a SELECT item list for use
* with the ORDER BY, GROUP BY, and HAVING clause disambiguation algorithm.
*
* @see WP_SQLite_Driver::disambiguate_item()
* @see WP_MySQL_On_SQLite::disambiguate_item()
*
* @param WP_Parser_Node $select_item_list The "selectItemList" AST node.
* @return array The SELECT item disambiguation map (column name => array of select items).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class WP_SQLite_Configurator {
/**
* The SQLite driver instance.
*
* @var WP_PDO_MySQL_On_SQLite
* @var WP_MySQL_On_SQLite
*/
private $driver;

Expand All @@ -35,11 +35,11 @@ class WP_SQLite_Configurator {
/**
* Constructor.
*
* @param WP_PDO_MySQL_On_SQLite $driver The SQLite driver instance.
* @param WP_MySQL_On_SQLite $driver The SQLite driver instance.
* @param WP_SQLite_Information_Schema_Builder $schema_builder The information schema builder instance.
*/
public function __construct(
WP_PDO_MySQL_On_SQLite $driver,
WP_MySQL_On_SQLite $driver,
WP_SQLite_Information_Schema_Builder $schema_builder
) {
$this->driver = $driver;
Expand Down Expand Up @@ -100,7 +100,7 @@ private function ensure_global_variables_table(): void {
sprintf(
'CREATE TABLE IF NOT EXISTS %s (name TEXT PRIMARY KEY, value TEXT)',
$this->driver->get_connection()->quote_identifier(
WP_PDO_MySQL_On_SQLite::GLOBAL_VARIABLES_TABLE_NAME
WP_MySQL_On_SQLite::GLOBAL_VARIABLES_TABLE_NAME
)
)
);
Expand Down Expand Up @@ -260,11 +260,11 @@ private function save_current_driver_version(): void {
sprintf(
'INSERT INTO %s (name, value) VALUES (?, ?) ON CONFLICT(name) DO UPDATE SET value = ?',
$this->driver->get_connection()->quote_identifier(
WP_PDO_MySQL_On_SQLite::GLOBAL_VARIABLES_TABLE_NAME
WP_MySQL_On_SQLite::GLOBAL_VARIABLES_TABLE_NAME
)
),
array(
WP_PDO_MySQL_On_SQLite::DRIVER_VERSION_VARIABLE_NAME,
WP_MySQL_On_SQLite::DRIVER_VERSION_VARIABLE_NAME,
SQLITE_DRIVER_VERSION,
SQLITE_DRIVER_VERSION,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@ class WP_SQLite_Driver_Exception extends PDOException {
/**
* The SQLite driver that originated the exception.
*
* @var WP_PDO_MySQL_On_SQLite
* @var WP_MySQL_On_SQLite
*/
private $driver;

/**
* Constructor.
*
* @param WP_PDO_MySQL_On_SQLite $driver The SQLite driver that originated the exception.
* @param WP_MySQL_On_SQLite $driver The SQLite driver that originated the exception.
* @param string $message The exception message.
* @param int|string $code The exception code. In PDO, it can be a string with value of SQLSTATE.
* @param Throwable|null $previous The previous throwable used for the exception chaining.
*/
public function __construct(
WP_PDO_MySQL_On_SQLite $driver,
WP_MySQL_On_SQLite $driver,
string $message,
$code = 0,
?Throwable $previous = null
Expand All @@ -27,7 +27,7 @@ public function __construct(
$this->driver = $driver;
}

public function getDriver(): WP_PDO_MySQL_On_SQLite {
public function getDriver(): WP_MySQL_On_SQLite {
return $this->driver;
}
}
Loading
Loading