summaryrefslogtreecommitdiff
path: root/sql-bench
diff options
context:
space:
mode:
authorwalrus@mysql.com <>2002-11-28 20:01:17 +0500
committerwalrus@mysql.com <>2002-11-28 20:01:17 +0500
commitfbbc087ade56cd0e475abe4f8a7081eb3bba5e46 (patch)
treefe0fd40db0d8e13758e02907a0cc3b8dfa12783c /sql-bench
parent0e69119f0e847e78df226253ce6a24a003f01567 (diff)
downloadmariadb-git-fbbc087ade56cd0e475abe4f8a7081eb3bba5e46.tar.gz
Merge constraint tests with "ignoring constarint tests"
for column,table and named constarints. Now constraint test produces exactly one line in report, with "yes","no" or syntax only". add /odbc to server-version if benchmark/crash-me works over odbc
Diffstat (limited to 'sql-bench')
-rw-r--r--sql-bench/crash-me.sh50
-rw-r--r--sql-bench/server-cfg.sh40
2 files changed, 62 insertions, 28 deletions
diff --git a/sql-bench/crash-me.sh b/sql-bench/crash-me.sh
index 5fa67773566..d9453948d1e 100644
--- a/sql-bench/crash-me.sh
+++ b/sql-bench/crash-me.sh
@@ -1,4 +1,3 @@
-#!@PERL@
# Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
#
# This library is free software; you can redistribute it and/or
@@ -1720,32 +1719,22 @@ if ($limits{'foreign_key'} eq 'yes')
}
}
-report("Column constraints","constraint_check",
- "create table crash_q (a int check (a>0))",
- "drop table crash_q $drop_attr");
-
-report("Ignoring column constraints","ignoring_constraint_check",
- "create table crash_q (a int check (a>0))",
- "insert into crash_q values(0)",
- "drop table crash_q $drop_attr") if ($limits{'constraint_check'} eq 'yes');
+check_constraint("Column constraints","constraint_check",
+ "create table crash_q (a int check (a>0))",
+ "insert into crash_q values(0)",
+ "drop table crash_q $drop_attr");
-report("Table constraints","constraint_check_table",
- "create table crash_q (a int ,b int, check (a>b))",
- "drop table crash_q $drop_attr");
-report("Ignoring table constraints","ignoring_constraint_check_table",
+check_constraint("Table constraints","constraint_check_table",
"create table crash_q (a int ,b int, check (a>b))",
"insert into crash_q values(0,0)",
- "drop table crash_q $drop_attr") if ($limits{'constraint_check_table'} eq 'yes');
-
-report("Named constraints","constraint_check_named",
- "create table crash_q (a int ,b int, constraint abc check (a>b))",
"drop table crash_q $drop_attr");
-report("Ignoring named constraints","ignoring_constraint_check_named",
+check_constraint("Named constraints","constraint_check_named",
"create table crash_q (a int ,b int, constraint abc check (a>b))",
"insert into crash_q values(0,0)",
- "drop table crash_q $drop_attr") if ($limits{'constraint_check_named'} eq 'yes');
+ "drop table crash_q $drop_attr");
+
report("NULL constraint (SyBase style)","constraint_null",
"create table crash_q (a int null)",
@@ -2236,6 +2225,29 @@ sub check_parenthesis {
save_config_data($param_name,$resultat,$fn);
}
+sub check_constraint {
+ my $prompt = shift;
+ my $key = shift;
+ my $create = shift;
+ my $check = shift;
+ my $drop = shift;
+ save_incomplete($key,$prompt);
+ print "$prompt=";
+ my $res = 'no';
+
+ if ( ($t=safe_query($create)) == 1)
+ {
+ $res='yes';
+ if (safe_query($check) == 1)
+ {
+ $res='syntax only';
+ }
+ }
+ safe_query($drop);
+ save_config_data($key,$res,$prompt);
+ print "$res\n";
+}
+
sub usage
{
print <<EOF;
diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
index 213ecacea6f..91a40d92772 100644
--- a/sql-bench/server-cfg.sh
+++ b/sql-bench/server-cfg.sh
@@ -216,6 +216,7 @@ sub version
}
$sth->finish;
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -431,6 +432,8 @@ sub version
{ # Strip pre- and endspace
$tmp=$1;
$tmp =~ s/\s+/ /g; # Remove unnecessary spaces
+ $tmp .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
+
return $tmp;
}
}
@@ -619,6 +622,7 @@ sub new
sub version
{
my ($version,$dir);
+ $version = "PostgreSQL version ???";
foreach $dir ($ENV{'PGDATA'},"/usr/local/pgsql/data", "/usr/local/pg/data")
{
if ($dir && -e "$dir/PG_VERSION")
@@ -627,11 +631,13 @@ sub version
if ($? == 0)
{
chomp($version);
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return "PostgreSQL $version";
}
}
}
- return "PostgreSQL version ???";
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
+ return $version;
}
@@ -895,6 +901,7 @@ sub new
sub version
{
my ($version,$dir);
+ $version="Solid version ??";
foreach $dir ($ENV{'SOLIDDIR'},"/usr/local/solid", "/my/local/solid")
{
if ($dir && -e "$dir/bin/solcon")
@@ -903,11 +910,13 @@ sub version
if ($? == 0)
{
chomp($version);
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
}
}
- return "Solid version ???";
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
+ return $version;
}
sub connect
@@ -1136,6 +1145,8 @@ sub version
{
$version="Empress version ???";
}
+
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -1403,6 +1414,7 @@ sub version
}
$sth->finish;
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -1647,6 +1659,7 @@ sub version
}
$sth->finish;
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -1846,7 +1859,9 @@ sub new
sub version
{
my ($self)=@_;
- return "Access 2000"; #DBI/ODBC can't return the server version
+ my $version="Access 2000";
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
+ return $version; #DBI/ODBC can't return the server version
}
sub connect
@@ -2028,7 +2043,8 @@ sub new
sub version
{
my ($self)=@_;
- my($sth,@row);
+ my($sth,@row, $version);
+ $version='MS SQL server ?';
$dbh=$self->connect();
$sth = $dbh->prepare("SELECT \@\@VERSION") or die $DBI::errstr;
$sth->execute or die $DBI::errstr;
@@ -2036,10 +2052,11 @@ sub version
if ($row[0]) {
@server = split(/\n/,$row[0]);
chomp(@server);
- return "$server[0]";
- } else {
- return "Microsoft SQL server ?";
- }
+ $version= "$server[0]";
+ }
+ $sth->finish;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
+ return $version;
}
sub connect
@@ -2232,8 +2249,8 @@ sub version
}
$sth->finish;
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
-
}
sub connect
@@ -2466,6 +2483,7 @@ sub version
}
$sth->finish;
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -2842,6 +2860,7 @@ sub version
#
$version = $dbh->func(18, GetInfo);
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -3041,6 +3060,7 @@ sub version
# $version =~ s/.*version \"(.*)\"$/$1/;
$dbh->disconnect;
$version = "6.0Beta";
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -3246,6 +3266,7 @@ sub version
#$version = $dbh->func(18, GetInfo);
$version="FrontBase 3.3";
# $dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -3453,6 +3474,7 @@ sub version
}
$sth->finish;
$dbh->disconnect;
+ $version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}