summaryrefslogtreecommitdiff
path: root/sql-bench
diff options
context:
space:
mode:
authorunknown <walrus@kishkin.ru>2002-12-10 19:09:56 +0500
committerunknown <walrus@kishkin.ru>2002-12-10 19:09:56 +0500
commit448644dc6bdd0abb71fe3b7dfc8ec5c20365f027 (patch)
tree0e0936163cad28bcb47187681da6d697b30dd498 /sql-bench
parent5a55e25c8734c349abf9c3db54823105a365de49 (diff)
downloadmariadb-git-448644dc6bdd0abb71fe3b7dfc8ec5c20365f027.tar.gz
SCRUM task - cleanup interbase section in the server-cfg
sql-bench/server-cfg.sh: clean-up interbase section corrected misprint in DSN, creating indexes,version(), and fields conversations. BitKeeper/etc/logging_ok: Logging to logging@openlogging.org accepted
Diffstat (limited to 'sql-bench')
-rw-r--r--sql-bench/server-cfg.sh39
1 files changed, 17 insertions, 22 deletions
diff --git a/sql-bench/server-cfg.sh b/sql-bench/server-cfg.sh
index 7f96c06ef99..c8c298ef1a7 100644
--- a/sql-bench/server-cfg.sh
+++ b/sql-bench/server-cfg.sh
@@ -2985,7 +2985,7 @@ sub new
bless $self;
$self->{'cmp_name'} = "interbase";
- $self->{'data_source'} = "DBI:InterBase:database=$database:ib_dialect=3";
+ $self->{'data_source'} = "DBI:InterBase:database=$database;ib_dialect=3";
$self->{'limits'} = \%limits;
$self->{'blob'} = "blob";
$self->{'text'} = "";
@@ -3000,7 +3000,7 @@ sub new
$limits{'max_tables'} = 65000; # Should be big enough
$limits{'max_text_size'} = 15000; # Max size with default buffers.
$limits{'query_size'} = 1000000; # Max size with default buffers.
- $limits{'max_index'} = 31; # Max number of keys
+ $limits{'max_index'} = 65000; # Max number of keys
$limits{'max_index_parts'} = 8; # Max segments/key
$limits{'max_column_name'} = 128; # max table and column name
@@ -3050,16 +3050,13 @@ sub new
sub version
{
my ($self)=@_;
- my ($dbh,$sth,$version,@row);
-
+ my ($dbh,$version);
+
+ $version='Interbase ?';
+
$dbh=$self->connect();
-# $sth = $dbh->prepare("show version");
-# $sth->execute;
-# @row = $sth->fetchrow_array;
-# $version = $row[0];
-# $version =~ s/.*version \"(.*)\"$/$1/;
+ eval { $version = $dbh->func('version','ib_database_info')->{'version'}; };
$dbh->disconnect;
- $version = "6.0Beta";
$version .= "/ODBC" if ($self->{'data_source'} =~ /:ODBC:/);
return $version;
}
@@ -3090,36 +3087,34 @@ sub connect
sub create
{
my($self,$table_name,$fields,$index,$options) = @_;
- my($query,@queries);
+ my($query,@queries,@keys,@indexes);
$query="create table $table_name (";
foreach $field (@$fields)
{
- $field =~ s/ big_decimal/ float/i;
- $field =~ s/ double/ float/i;
+ $field =~ s/ big_decimal/ decimal/i;
+ $field =~ s/ double/ double precision/i;
$field =~ s/ tinyint/ smallint/i;
- $field =~ s/ mediumint/ int/i;
- $field =~ s/ integer/ int/i;
+ $field =~ s/ mediumint/ integer/i;
+ $field =~ s/\bint\b/integer/i;
$field =~ s/ float\(\d,\d\)/ float/i;
- $field =~ s/ date/ int/i; # Because of tcp ?
$field =~ s/ smallint\(\d\)/ smallint/i;
- $field =~ s/ int\(\d\)/ int/i;
+ $field =~ s/ integer\(\d\)/ integer/i;
$query.= $field . ',';
}
foreach $ind (@$index)
{
- my @index;
- if ( $ind =~ /\bKEY\b/i ){
+ if ( $ind =~ /(\bKEY\b)|(\bUNIQUE\b)/i ){
push(@keys,"ALTER TABLE $table_name ADD $ind");
}else{
- my @fields = split(' ',$index);
+ my @fields = split(' ',$ind);
my $query="CREATE INDEX $fields[1] ON $table_name $fields[2]";
- push(@index,$query);
+ push(@indexes,$query);
}
}
substr($query,-1)=")"; # Remove last ',';
$query.=" $options" if (defined($options));
- push(@queries,$query);
+ push(@queries,$query,@keys,@indexes);
return @queries;
}