Skip to content

Commit

Permalink
Merge branch 'master' of github.com:c9s/SQLBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
c9s committed Jun 10, 2016
2 parents 94b1934 + 0729d66 commit ad46b9e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions SQLBuilder/Driver/MySQLDriver.php
Expand Up @@ -21,6 +21,14 @@ public function quoteIdentifier($id) {
return '`' . addcslashes($id,'`') . '`';
}

public function cast($value)
{
if (is_bool($value)) {
return intval($value);
}
return $value;
}

public function deflate($value, ArgumentArray $args = NULL)
{
if ($value instanceof DateTime) {
Expand Down
2 changes: 1 addition & 1 deletion SQLBuilder/Universal/Syntax/Column.php
Expand Up @@ -662,7 +662,7 @@ public function getName() {

public function buildNullClause(BaseDriver $driver)
{
if ($this->required || $this->notNull) {
if ($this->notNull) {
return ' NOT NULL';
} elseif ($this->notNull === FALSE) {
return ' NULL';
Expand Down

0 comments on commit ad46b9e

Please sign in to comment.