diff options
author | monty@mysql.com <> | 2004-04-30 14:02:17 +0300 |
---|---|---|
committer | monty@mysql.com <> | 2004-04-30 14:02:17 +0300 |
commit | 6678ecf19a0daf521af92a7d175b1525f9a51ab5 (patch) | |
tree | e1353cabd03b354f8b81634423e6b0e5cb0e54f5 /scripts | |
parent | 32d0b695031f281aa4079838785c4c770d7cf30a (diff) | |
download | mariadb-git-6678ecf19a0daf521af92a7d175b1525f9a51ab5.tar.gz |
Update 'MYSQL_FIELD->max_length' on mysql_stmt_store_result() (Bug #1647)
Added checking of cut read lines in bootstrap thread (Bug #2874)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/fill_help_tables.sh | 47 | ||||
-rw-r--r-- | scripts/mysql_install_db.sh | 31 |
2 files changed, 62 insertions, 16 deletions
diff --git a/scripts/fill_help_tables.sh b/scripts/fill_help_tables.sh index cb5437f7178..a62fe0e0b11 100644 --- a/scripts/fill_help_tables.sh +++ b/scripts/fill_help_tables.sh @@ -45,6 +45,7 @@ use strict; use Getopt::Long; my $insert_portion_size= 15; +my $maximum_line_length= 2040; my $error_prefix= "---- help parsing errors :"; my $path_to_lex_file= "../sql/lex.h"; @@ -166,6 +167,7 @@ sub add_description print_error "double description for $topic_name\n"; } $topics{$topic_name}->{description}= $description; + $topics{$topic_name}->{line_of_description}= $cur_line; add_topic_to_category($topic_name); } @@ -515,21 +517,52 @@ if (scalar(@topic_names)) { my $header= "insert into help_topic ". "(help_topic_id,help_category_id,name,description,example) values "; + my $line_accumulator= $header; + my $lines_in_accumulator= 0; + my $actual_max_line_length= $maximum_line_length-2; # for ";\n" my $topic_name; my $count= 0; foreach $topic_name (@topic_names) { - print_insert_header($count,$header); my $topic= $topics{$topic_name}; - print "($count,"; - print "$topic->{category}->{__id__},"; - print "\"$topic_name\","; - print "\"$topic->{description}\","; - print "\"$topic->{example}\")"; + my $line= "($count,"; + $line.= "$topic->{category}->{__id__},"; + $line.= "\"$topic_name\","; + $line.= "\"$topic->{description}\","; + $line.= "\"$topic->{example}\")"; + if ($lines_in_accumulator <= $insert_portion_size && + length($line) + length($line_accumulator) < $actual_max_line_length) + { + if ($lines_in_accumulator ne 0) + { + $line_accumulator.= ","; + } + $line_accumulator.= $line; + $lines_in_accumulator++; + } + else + { + if (length($line) + length($header) >= $actual_max_line_length) + { + $cur_line= $topics{$topic_name}->{line_of_description}; + print_error "too long record for topic \"$topic_name\" \n". + " please decrease its description or example!\n"; + } + else + { + print "$line_accumulator;\n"; + $line_accumulator= $header.$line; + $lines_in_accumulator= 1; + } + } $topics{$topic_name}->{__id__}= $count; $count++; } - printf ";\n\n"; + if ($lines_in_accumulator ne 0) + { + print "$line_accumulator;\n"; + } + printf "\n"; } my @keywords_names= keys(%keywords); diff --git a/scripts/mysql_install_db.sh b/scripts/mysql_install_db.sh index 1861e8c52f8..61d173aac05 100644 --- a/scripts/mysql_install_db.sh +++ b/scripts/mysql_install_db.sh @@ -200,15 +200,28 @@ if test "$in_rpm" -eq 0 -a "$windows" -eq 0 then echo "Installing all prepared tables" fi -if ( - $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows - if test -n "$fill_help_tables" - then - cat $fill_help_tables - fi -) | eval "$mysqld $defaults $mysqld_opt --bootstrap --skip-grant-tables \ - --basedir=$basedir --datadir=$ldata --skip-innodb --skip-bdb $args" +mysqld_install_cmd_line="$mysqld $defaults $mysqld_opt --bootstrap \ +--skip-grant-tables --basedir=$basedir --datadir=$ldata --skip-innodb \ +--skip-bdb $args" +if $scriptdir/mysql_create_system_tables $create_option $mdata $hostname $windows \ + | eval "$mysqld_install_cmd_line" then + if test -n "$fill_help_tables" + then + if test "$in_rpm" -eq 0 -a "$windows" -eq 0 + then + echo "Fill help tables" + fi + if ! (echo "use mysql; + " + cat $fill_help_tables) | eval "$mysqld_install_cmd_line" + then + echo "" + echo "WARNING: HELP FILES ARE NOT COMPLETELY INSTALLED!" + echo "The \"HELP\" command might not work properly" + echo "" + fi + fi if test "$in_rpm" = 0 -a "$windows" = 0 then echo "" @@ -250,7 +263,7 @@ then fi exit 0 else - echo "Installation of grant tables failed!" + echo "Installation of system tables failed!" echo echo "Examine the logs in $ldata for more information." echo "You can also try to start the mysqld daemon with:" |