Skip to content

Commit

Permalink
Fix connection count query for mariadb
Browse files Browse the repository at this point in the history
  • Loading branch information
GromNaN committed Jul 23, 2024
1 parent 61316c4 commit bdc79bf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions src/Illuminate/Database/Schema/Grammars/MariaDbGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ protected function typeGeometry(Fluent $column)
$column->srid ? ' ref_system_id='.$column->srid : ''
);
}

public function compileConnectionCount()
{
return 'select variable_value as `Value` from information_schema.global_status where variable_name = \'Threads_connected\'';
}
}
2 changes: 1 addition & 1 deletion src/Illuminate/Database/Schema/Grammars/MySqlGrammar.php
Original file line number Diff line number Diff line change
Expand Up @@ -1340,6 +1340,6 @@ protected function wrapJsonSelector($value)

public function compileConnectionCount()
{
return 'select variable_value as `Value` from performance_schema.session_status where variable_name = "threads_connected"';
return 'select variable_value as `Value` from performance_schema.session_status where variable_name = \'threads_connected\'';
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1057,6 +1057,6 @@ public function quoteString($value)

public function compileConnectionCount()
{
return 'select count(*) Value from sys.dm_exec_sessions where status = "running"';
return 'select count(*) Value from sys.dm_exec_sessions where status = N\'running\'';
}
}

0 comments on commit bdc79bf

Please sign in to comment.