Fix incorrect SQL values for boolean fields

fixes #8100
This commit is contained in:
Gunnar Beutner 2014-12-16 21:23:50 +01:00
parent 96626f4eca
commit 5e1182a5c7
2 changed files with 16 additions and 2 deletions

View File

@ -570,7 +570,14 @@ bool IdoMysqlConnection::FieldToEscapedString(const String& key, const Value& va
} else if (DbValue::IsTimestampNow(value)) { } else if (DbValue::IsTimestampNow(value)) {
*result = "NOW()"; *result = "NOW()";
} else { } else {
*result = "'" + Escape(rawvalue) + "'"; Value fvalue;
if (rawvalue.IsBoolean())
fvalue = Convert::ToLong(rawvalue);
else
fvalue = rawvalue;
*result = "'" + Escape(fvalue) + "'";
} }
return true; return true;

View File

@ -564,7 +564,14 @@ bool IdoPgsqlConnection::FieldToEscapedString(const String& key, const Value& va
} else if (DbValue::IsTimestampNow(value)) { } else if (DbValue::IsTimestampNow(value)) {
*result = "NOW()"; *result = "NOW()";
} else { } else {
*result = "E'" + Escape(rawvalue) + "'"; Value fvalue;
if (rawvalue.IsBoolean())
fvalue = Convert::ToLong(rawvalue);
else
fvalue = rawvalue;
*result = "E'" + Escape(fvalue) + "'";
} }
return true; return true;