Skip to content

Commit

Permalink
Enforced basic constraints for some fields in temporary tables.
Browse files Browse the repository at this point in the history
git-svn-id: http://voip.null.ro/svn/ansql/trunk@269 dbfed7de-b0aa-0410-b6a1-c7e608b77fc9
  • Loading branch information
dana committed Nov 4, 2016
1 parent e8cb6b8 commit ae12341
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@ public static function createTable($table,$vars)
if ($type == "bigint(20) unsigned not null auto_increment")
$query.= ", primary key ($name)";
} else {
if (substr($table,0,6)=="_temp_" && ($name == 'inserted' || $name == 'deleted')) {
$old_enforce_basic_constrains = $enforce_basic_constrains;
$enforce_basic_constrains = true;
}
$query.= esc($name)." $type";
if (!$enforce_basic_constrains)
continue;
Expand All @@ -571,6 +575,9 @@ public static function createTable($table,$vars)
$value = $var->escape($var->_value);
$query.= " DEFAULT ".$value;
}
if (substr($table,0,6)=="_temp_" && ($name == 'inserted' || $name == 'deleted'))
$enforce_basic_constrains = $old_enforce_basic_constrains;

}
}

Expand Down

0 comments on commit ae12341

Please sign in to comment.