summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorNirbhay Choubey <nirbhay@mariadb.com>2015-12-19 14:24:38 -0500
committerNirbhay Choubey <nirbhay@mariadb.com>2015-12-19 14:24:38 -0500
commitdad555a09c8d590132c77c192a18d7fc1f8fe91e (patch)
tree38fb545e5df0a24333b8284c816f5bea95d19a03 /scripts
parent18173ddfc4081407832d9a6703d1b8356b7defe9 (diff)
parent90ea0145856338221803ebb9b446ed2a6e082412 (diff)
downloadmariadb-git-dad555a09c8d590132c77c192a18d7fc1f8fe91e.tar.gz
Merge tag 'mariadb-10.0.23' into 10.0-galera
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mysql_system_tables.sql2
-rw-r--r--scripts/mysql_system_tables_fix.sql2
-rw-r--r--scripts/mysqld_multi.sh27
3 files changed, 19 insertions, 12 deletions
diff --git a/scripts/mysql_system_tables.sql b/scripts/mysql_system_tables.sql
index bc89ae82dbb..14b59bb3411 100644
--- a/scripts/mysql_system_tables.sql
+++ b/scripts/mysql_system_tables.sql
@@ -220,7 +220,7 @@ set @had_proxies_priv_table= @@warning_count != 0;
CREATE TABLE IF NOT EXISTS table_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, cardinality bigint(21) unsigned DEFAULT NULL, PRIMARY KEY (db_name,table_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Tables';
-CREATE TABLE IF NOT EXISTS column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varchar(255) DEFAULT NULL, max_value varchar(255) DEFAULT NULL, nulls_ratio decimal(12,4) DEFAULT NULL, avg_length decimal(12,4) DEFAULT NULL, avg_frequency decimal(12,4) DEFAULT NULL, hist_size tinyint unsigned, hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB'), histogram varbinary(255), PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
+CREATE TABLE IF NOT EXISTS column_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, column_name varchar(64) NOT NULL, min_value varbinary(255) DEFAULT NULL, max_value varbinary(255) DEFAULT NULL, nulls_ratio decimal(12,4) DEFAULT NULL, avg_length decimal(12,4) DEFAULT NULL, avg_frequency decimal(12,4) DEFAULT NULL, hist_size tinyint unsigned, hist_type enum('SINGLE_PREC_HB','DOUBLE_PREC_HB'), histogram varbinary(255), PRIMARY KEY (db_name,table_name,column_name) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Columns';
CREATE TABLE IF NOT EXISTS index_stats (db_name varchar(64) NOT NULL, table_name varchar(64) NOT NULL, index_name varchar(64) NOT NULL, prefix_arity int(11) unsigned NOT NULL, avg_frequency decimal(12,4) DEFAULT NULL, PRIMARY KEY (db_name,table_name,index_name,prefix_arity) ) ENGINE=MyISAM CHARACTER SET utf8 COLLATE utf8_bin comment='Statistics on Indexes';
diff --git a/scripts/mysql_system_tables_fix.sql b/scripts/mysql_system_tables_fix.sql
index 33b4306b103..f034af4f898 100644
--- a/scripts/mysql_system_tables_fix.sql
+++ b/scripts/mysql_system_tables_fix.sql
@@ -711,3 +711,5 @@ flush privileges;
ALTER TABLE help_category MODIFY url TEXT NOT NULL;
ALTER TABLE help_topic MODIFY url TEXT NOT NULL;
+# MDEV-7383 - varbinary on mix/max of column_stats
+alter table column_stats modify min_value varbinary(255) DEFAULT NULL, modify max_value varbinary(255) DEFAULT NULL;
diff --git a/scripts/mysqld_multi.sh b/scripts/mysqld_multi.sh
index 56885137a4b..3d754ac88fb 100644
--- a/scripts/mysqld_multi.sh
+++ b/scripts/mysqld_multi.sh
@@ -572,11 +572,9 @@ sub get_mysqladmin_options
return $com;
}
-####
-#### Return a list of option files which can be opened. Similar, but not
-#### identical, to behavior of my_search_option_files()
-####
-
+# Return a list of option files which can be opened. Similar, but not
+# identical, to behavior of my_search_option_files()
+# TODO implement and use my_print_defaults --list-groups instead
sub list_defaults_files
{
my %opt;
@@ -588,9 +586,7 @@ sub list_defaults_files
return ($opt{file}) if exists $opt{file};
- my %seen; # Don't list the same file more than once
- return grep { defined $_ and not $seen{$_}++ and -f $_ and -r $_ }
- ('@sysconfdir@/my.cnf',
+ return ('@sysconfdir@/my.cnf',
'@sysconfdir@/mysql/my.cnf',
'@prefix@/my.cnf',
($ENV{MYSQL_HOME} ? "$ENV{MYSQL_HOME}/my.cnf" : undef),
@@ -632,11 +628,12 @@ sub find_groups
}
}
+ my %seen;
my @defaults_files = list_defaults_files();
- #warn "@{[sort keys %gids]} -> @defaults_files\n";
- foreach my $file (@defaults_files)
+ while (@defaults_files)
{
- next unless open CONF, "< $file";
+ my $file = shift @defaults_files;
+ next unless defined $file and not $seen{$file}++ and open CONF, '<', $file;
while (<CONF>)
{
@@ -649,6 +646,14 @@ sub find_groups
push @groups, "$1$2";
}
}
+ elsif (/^\s*!include\s+(\S.*?)\s*$/)
+ {
+ push @defaults_files, $1;
+ }
+ elsif (/^\s*!includedir\s+(\S.*?)\s*$/)
+ {
+ push @defaults_files, <$1/*.cnf>;
+ }
}
close CONF;