Skip to content

Commit 740235b

Browse files
authored
Merge branch 'main' into copilot/fix-mysqlcheck-character-set-error
2 parents 188e78d + 9f32ef9 commit 740235b

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

.github/workflows/code-quality.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
branches:
77
- main
88
- master
9+
schedule:
10+
- cron: '17 2 * * *' # Run every day on a seemly random time.
911

1012
jobs:
1113
code-quality:

.github/workflows/copilot-setup-steps.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838

3939
- name: Install Composer dependencies & cache dependencies
4040
if: steps.check_composer_file.outputs.files_exists == 'true'
41-
uses: ramsey/composer-install@3cf229dc2919194e9e36783941438d17239e8520 # v3
41+
uses: ramsey/composer-install@a35c6ebd3d08125aaf8852dff361e686a1a67947 # v3
4242
env:
4343
COMPOSER_ROOT_VERSION: dev-${{ github.event.repository.default_branch }}
4444
with:

src/DB_Command.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ public function query( $args, $assoc_args ) {
538538
$assoc_args['execute'] = $this->get_sql_mode_query( $assoc_args ) . $assoc_args['execute'];
539539
}
540540

541-
$is_row_modifying_query = isset( $assoc_args['execute'] ) && preg_match( '/\b(UPDATE|DELETE|INSERT|REPLACE|LOAD DATA)\b/i', $assoc_args['execute'] );
541+
$is_row_modifying_query = isset( $assoc_args['execute'] ) && preg_match( '/\b(UPDATE|DELETE|INSERT|REPLACE(?!\s*\()|LOAD DATA)\b/i', $assoc_args['execute'] );
542542

543543
if ( $is_row_modifying_query ) {
544544
$assoc_args['execute'] .= '; SELECT ROW_COUNT();';
@@ -1161,6 +1161,12 @@ public function size( $args, $assoc_args ) {
11611161
$size_key = floor( log( (float) $row['Size'] ) / log( 1000 ) );
11621162
$sizes = [ 'B', 'KB', 'MB', 'GB', 'TB' ];
11631163

1164+
if ( is_infinite( $size_key ) ) {
1165+
$size_key = 0;
1166+
}
1167+
1168+
$size_key = (int) $size_key;
1169+
11641170
$size_format = isset( $sizes[ $size_key ] ) ? $sizes[ $size_key ] : $sizes[0];
11651171
}
11661172

0 commit comments

Comments
 (0)