Skip to content

Commit

Permalink
Fix warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
hschletz committed Oct 28, 2022
1 parent 11f5946 commit c30bbb5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Column/Pgsql.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ protected function _parseDefault($data)
{
parent::_parseDefault($data);
// Extract value from typed defaults
if (preg_match("/^('(.*)'|NULL)::$data[data_type]\$/", $this->_default, $matches)) {
if (
!is_null($this->_default) && // already NULL, no additional parsing
preg_match("/^('(.*)'|NULL)::$data[data_type]\$/", $this->_default, $matches)
) {
if ($matches[1] == 'NULL') {
$this->_default = null;
} else {
Expand Down Expand Up @@ -124,6 +127,7 @@ protected function _isAutoIncrement($data)
{
if (
($data['data_type'] == 'integer' or $data['data_type'] == 'bigint')
and $data['column_default']
and strpos($data['column_default'], 'nextval(') === 0
) {
return true;
Expand Down

0 comments on commit c30bbb5

Please sign in to comment.