Merge remote-tracking branch 'stentroad/custom'

This commit is contained in:
Alexey Romanov
2014-10-10 10:28:39 +04:00
2 changed files with 2 additions and 1 deletions

View File

@@ -433,7 +433,7 @@ static int bind_parameters(
return output_error(drv, SQLITE_ERROR,
"error while binding parameters");
}
acc_string = driver_alloc(sizeof(char*) * (*p_size + 1));
acc_string = driver_alloc(sizeof(char) * (*p_size + 1));
ei_decode_string(buffer, p_index, acc_string);
for (param_index = 1; param_index <= *p_size; param_index++) {
sqlite3_bind_int(statement, param_index, (int) (unsigned char) acc_string[param_index - 1]);

View File

@@ -364,6 +364,7 @@ constraint_sql(Constraint) ->
unique -> "UNIQUE";
not_null -> "NOT NULL";
{default, DefaultValue} -> ["DEFAULT ", value_to_sql(DefaultValue)];
{raw, S} when is_list(S) -> S;
_ when is_list(Constraint) -> map_intersperse(fun constraint_sql/1, Constraint, " ")
end.