Merged in feature/314-dev-dev01 (pull request #24)
auto-patch 314-dev-dev01-2024-01-25T04_09_02 * auto-patch 314-dev-dev01-2024-01-25T04_09_02
This commit is contained in:
@@ -125,6 +125,8 @@ class Adapter {
|
||||
|
||||
/**
|
||||
* Create the schema table, if necessary.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function create_schema_version_table() {
|
||||
if ( ! $this->has_table( $this->get_schema_version_table_name() ) ) {
|
||||
@@ -137,6 +139,8 @@ class Adapter {
|
||||
|
||||
/**
|
||||
* Starts a transaction.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function start_transaction() {
|
||||
if ( $this->in_transaction() === false ) {
|
||||
@@ -146,6 +150,8 @@ class Adapter {
|
||||
|
||||
/**
|
||||
* Commits a transaction.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function commit_transaction() {
|
||||
if ( $this->in_transaction() ) {
|
||||
@@ -155,6 +161,8 @@ class Adapter {
|
||||
|
||||
/**
|
||||
* Rollbacks a transaction.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function rollback_transaction() {
|
||||
if ( $this->in_transaction() ) {
|
||||
@@ -293,7 +301,7 @@ class Adapter {
|
||||
$query_type = $this->determine_query_type( $query );
|
||||
$data = [];
|
||||
if ( $query_type === Constants::SQL_SELECT || $query_type === Constants::SQL_SHOW ) {
|
||||
$data = $wpdb->get_results( $query, ARRAY_A );
|
||||
$data = $wpdb->get_results( $query, \ARRAY_A );
|
||||
if ( $data === false ) {
|
||||
return false;
|
||||
}
|
||||
@@ -794,10 +802,8 @@ class Adapter {
|
||||
$column_type_sql .= \sprintf( '(%d)', $precision );
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ( $scale ) {
|
||||
throw new Exception( "Error adding $type column: precision cannot be empty if scale is specified" );
|
||||
}
|
||||
elseif ( $scale ) {
|
||||
throw new Exception( "Error adding $type column: precision cannot be empty if scale is specified" );
|
||||
}
|
||||
}
|
||||
elseif ( $type === 'enum' ) {
|
||||
|
||||
Reference in New Issue
Block a user