Make NULL be case-insensitive

pull/4128/head
Isaac Connor 2024-09-03 09:50:58 -04:00
parent b66e04024f
commit 99f90724ed
1 changed files with 4 additions and 4 deletions

View File

@ -246,7 +246,7 @@ sub Sql {
$value = "'$ZoneMinder::Config::Config{ZM_SERVER_ID}'";
# This gets used later, I forget for what
$$self{Server} = new ZoneMinder::Server($ZoneMinder::Config::Config{ZM_SERVER_ID});
} elsif ( $temp_value eq 'NULL' ) {
} elsif ( uc($temp_value) eq 'NULL' ) {
$value = $temp_value;
} else {
$value = "'$temp_value'";
@ -268,7 +268,7 @@ sub Sql {
}
$value = "'$temp_value'";
} elsif ( $term->{attr} eq 'DateTime' or $term->{attr} eq 'StartDateTime' or $term->{attr} eq 'EndDateTime' ) {
if ( $temp_value eq 'NULL' ) {
if ( uc($temp_value) eq 'NULL' ) {
$value = $temp_value;
} else {
$value = DateTimeToSQL($temp_value);
@ -279,7 +279,7 @@ sub Sql {
$value = "'$value'";
}
} elsif ( $term->{attr} eq 'Date' or $term->{attr} eq 'StartDate' or $term->{attr} eq 'EndDate' ) {
if ( $temp_value eq 'NULL' ) {
if ( uc($temp_value) eq 'NULL' ) {
$value = $temp_value;
} elsif ( $temp_value eq 'CURDATE()' or $temp_value eq 'NOW()' ) {
$value = 'to_days('.$temp_value.')';
@ -292,7 +292,7 @@ sub Sql {
$value = "to_days( '$value' )";
}
} elsif ( $term->{attr} eq 'Time' or $term->{attr} eq 'StartTime' or $term->{attr} eq 'EndTime' ) {
if ( $temp_value eq 'NULL' ) {
if ( uc($temp_value) eq 'NULL' ) {
$value = $temp_value;
} else {
$value = DateTimeToSQL($temp_value);