Subject: | fail.t - "Create table" failing |
In fail.t, the "Create table" test is failing:
create table #test(
one int not null primary key,
two int not null,
three int not null check(two != three)
)
Basically, the error is that there is an "inline" check-constraint associated with column 'three'. However, according to http://stackoverflow.com/a/11184864/1540600, "Constraints that are defined inline at column level can only reference the column they are defined next to."
If we want a check that references both 'two' and 'three', we should make it a table constraint, not a column one. Just add one comma.
Sam
--- t\fail#2.t 2014-02-14 09:43:10.000000000 +-0100
+++ t\fail.t 2014-02-14 09:51:05.000000000 +-0100
@@ -51,13 +51,13 @@
ok(defined($rc), 'Sysusers');
while(my $d = $sth->fetch) {
;
}
-$rc = $dbh->do("create table #test(one int not null primary key, two int not null, three int not null check(two != three))");
+$rc = $dbh->do("create table #test(one int not null primary key, two int not null, three int not null, check(two != three))");
ok(defined($rc), 'Create table');
SKIP: {
skip '? placeholders not supported', 3 unless $dbh->{syb_dynamic_supported};