← Back to team overview

maria-developers team mailing list archive

Re: [Commits] 5d0e4ce: MySQL support added

 

Привет, Сергей!


О чем этот "суппорт", не обьяснишь одной фразой?

Спасибо!
Андрей

psergey <sergey@xxxxxxxxxxx> writes:

> revision-id: 5d0e4ce291ae940feaa8398435158dc56a3db3c4 ()
> parent(s): d504887718112e211544beca0e6651d5477466e1
> author: Sergei Petrunia
> committer: Sergei Petrunia
> timestamp: 2020-03-12 10:26:06 +0300
> message:
>
> MySQL support added
>
> ---
>  .gitignore                               |  1 +
>  filesort-bench1/06-make-varchar-bench.sh | 30 +++++++++++++++--
>  prepare-server.sh                        | 11 ++++--
>  setup-server/setup-mariadb-current.sh    |  6 ++--
>  setup-server/setup-mysql-8.0.sh          | 58 ++++++++++++++++++++++++++++++++
>  5 files changed, 98 insertions(+), 8 deletions(-)
>
> diff --git a/.gitignore b/.gitignore
> index fcd5175..3bccc18 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -23,3 +23,4 @@ my-10.5-old.cnf
>  mysql-boost
>  mysql-8.0
>  mysql8-data
> +mysql-8.0-data.clean/
> diff --git a/filesort-bench1/06-make-varchar-bench.sh b/filesort-bench1/06-make-varchar-bench.sh
> index 85afcfd..21da087 100644
> --- a/filesort-bench1/06-make-varchar-bench.sh
> +++ b/filesort-bench1/06-make-varchar-bench.sh
> @@ -29,6 +29,17 @@ create table test_run_queries (
>    test_time_ms bigint,
>    sort_merge_passes int
>  );
> +
> +drop view if exists session_status;
> +
> +set @var= IF(version() like '%8.0%', 
> +            'create view session_status as select * from performance_schema.session_status', 
> +            'create view session_status as select * from information_schema.session_status');
> +
> +prepare s from @var;
> +execute s;
> +
> +
>  END
>  
>  ###
> @@ -55,7 +66,18 @@ create table $test_table_name (
>    char_field varchar($varchar_size) character set utf8, b int
>  ) engine=myisam;
>  
> -insert into $rand_table_name select 1+floor(rand() * @n_countries) from seq_1_to_$table_size;
> +drop table if exists ten, one_k;
> +create table ten(a int);
> +insert into ten values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
> +
> +create table one_k(a int);
> +insert into one_k select A.a + B.a* 10 + C.a * 100 from ten A, ten B, ten C;
> +
> +set @a=0;
> +insert into $rand_table_name 
> +select 1+floor(rand() * @n_countries) 
> +from 
> +  (select @a:=@a+1 from one_k A, one_k B, one_k C limit $table_size) T;
>  insert into $test_table_name
>  select
>    (select Name from Country where id=T.a), 1234
> @@ -63,13 +85,15 @@ from $rand_table_name T ;
>  
>  drop table $rand_table_name;
>  analyze table $test_table_name;
> +select count(*) from $test_table_name;
> +show create table $test_table_name;
>  END
>  
>  for i in 1 2 3 4 5 6 7 8 9 10 ; do
>  
>  ### query_start.sql here:
>  cat <<END
> -select variable_value into @query_start_smp from information_schema.session_status where variable_name like 'sort_merge_passes';
> +select variable_value into @query_start_smp from session_status where variable_name like 'sort_merge_passes';
>  select current_timestamp(6) into @query_start_time;
>  END
>  ###
> @@ -87,7 +111,7 @@ echo $QUERY
>  cat << END
>  set @test_name='$TEST_NAME';
>  set @query_time_ms= timestampdiff(microsecond, @query_start_time, current_timestamp(6))/1000;
> -select variable_value into @query_end_smp from information_schema.session_status where variable_name like 'sort_merge_passes';
> +select variable_value into @query_end_smp from session_status where variable_name like 'sort_merge_passes';
>  set @query_merge_passes = @query_end_smp - @query_start_smp;
>  insert into test_run_queries
>           (table_size, varchar_size, test_ts, test_time_ms, sort_merge_passes)
> diff --git a/prepare-server.sh b/prepare-server.sh
> index 01dbeba..d4da8db 100755
> --- a/prepare-server.sh
> +++ b/prepare-server.sh
> @@ -38,6 +38,11 @@ if [ ! -d $SERVERNAME ]; then
>    exit 1
>  fi
>  
> +if [ ! -f $SERVERNAME-vars.sh ]; then 
> +  echo "Can't find settings file $SERVERNAME-vars.sh."
> +  exit 1
> +fi
> +
>  if [[ $USE_RAMDISK ]] ; then
>    echo " Using /dev/shm for data dir"
>  fi
> @@ -49,6 +54,8 @@ sleep 5
>  
>  DATA_DIR=$SERVERNAME-data
>  
> +source ${SERVERNAME}-vars.sh
> +
>  if [[ $RECOVER ]] ; then
>    echo "Recovering the existing datadir" 
>  else
> @@ -64,7 +71,7 @@ else
>  fi
>  
>  #exit 0;
> -./$SERVERNAME/sql/mysqld --defaults-file=./my-${SERVERNAME}.cnf & 
> +$MYSQLD --defaults-file=./my-${SERVERNAME}.cnf & 
>  
>  
>  server_attempts=0
> @@ -72,7 +79,7 @@ server_attempts=0
>  while true ; do
>    client_attempts=0
>    while true ; do
> -    ./$SERVERNAME/client/mysql --defaults-file=./my-${SERVERNAME}.cnf -uroot -e "create database sbtest"
> +    $MYSQL $MYSQL_ARGS -e "select 1"
>  
>      if [ $? -eq 0 ]; then
>        break
> diff --git a/setup-server/setup-mariadb-current.sh b/setup-server/setup-mariadb-current.sh
> index 1b49ef0..b6bc417 100755
> --- a/setup-server/setup-mariadb-current.sh
> +++ b/setup-server/setup-mariadb-current.sh
> @@ -85,16 +85,16 @@ innodb_buffer_pool_size=8G
>  
>  EOF
>  
> -cat > mysql-vars.sh <<EOF
> +cat > $DIRNAME-vars.sh <<EOF
>  MYSQL="`pwd`/$DIRNAME/client/mysql"
> +MYSQLD="`pwd`/$DIRNAME/sql/mysqld"
>  MYSQLSLAP="`pwd`/$DIRNAME/client/mysqlslap"
>  MYSQL_SOCKET="--socket=$SOCKETNAME"
>  MYSQL_USER="-uroot"
>  MYSQL_ARGS="\$MYSQL_USER \$MYSQL_SOCKET"
>  EOF
>  
> -source mysql-vars.sh
> -cp mysql-vars.sh $DIRNAME-vars.sh
> +source $DIRNAME-vars.sh
>  
>  (
>  cd $HOMEDIR/$DIRNAME/sql
> diff --git a/setup-server/setup-mysql-8.0.sh b/setup-server/setup-mysql-8.0.sh
> new file mode 100644
> index 0000000..ffd9987
> --- /dev/null
> +++ b/setup-server/setup-mysql-8.0.sh
> @@ -0,0 +1,58 @@
> +#!/bin/bash
> +
> +HOMEDIR=`pwd`
> +
> +BRANCH=8.0
> +SERVER_VERSION=8.0
> +DIRNAME="mysql-$SERVER_VERSION"
> +
> +git clone --branch $BRANCH --depth 1 https://github.com/mysql/mysql-server.git $DIRNAME
> +
> +cd mysql-$SERVER_VERSION
> +cmake . -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDOWNLOAD_BOOST=1 -DWITH_BOOST=$HOMEDIR/mysql-boost \
> + -DENABLE_DOWNLOADS=1 -DFORCE_INSOURCE_BUILD=1 -DWITH_UNIT_TESTS=0
> +
> +make -j8
> +
> +cd mysql-test
> +perl ./mysql-test-run alias
> +cp -r var/data $HOMEDIR/$DIRNAME-data
> +cp -r var/data $HOMEDIR/$DIRNAME-data.clean
> +cd ..
> +
> +
> +source_dir=`pwd`
> +socket_name="`basename $source_dir`.sock"
> +SOCKETNAME="/tmp/$socket_name"
> +
> +cat > $HOMEDIR/my-$DIRNAME.cnf <<EOF
> +
> +[mysqld]
> +datadir=$HOMEDIR/$DIRNAME-data
> +
> +tmpdir=/tmp
> +port=3320
> +socket=$SOCKETNAME
> +#binlog-format=row
> +gdb
> +lc_messages_dir=../share
> +server-id=12
> +bind-address=0.0.0.0
> +log-error
> +secure_file_priv=
> +innodb_buffer_pool_size=4G
> +EOF
> +
> +cat > $DIRNAME-vars.sh <<EOF
> +MYSQL="`pwd`/$DIRNAME/bin/mysql"
> +MYSQLD="`pwd`/$DIRNAME/bin/mysqld"
> +MYSQLSLAP="`pwd`/$DIRNAME/bin/mysqlslap"
> +MYSQL_SOCKET="--socket=$SOCKETNAME"
> +MYSQL_USER="-uroot"
> +MYSQL_ARGS="\$MYSQL_USER \$MYSQL_SOCKET"
> +EOF
> +
> +source $DIRNAME-vars.sh
> +
> +$MYSQLD --defaults-file=$HOMEDIR/my-$DIRNAME.cnf &
> +
> _______________________________________________
> commits mailing list
> commits@xxxxxxxxxxx
> https://lists.askmonty.org/cgi-bin/mailman/listinfo/commits