Bug #4890 Build Mysql Cluster
Submitted: 4 Aug 2004 6:09 Modified: 13 Aug 2004 22:31
Reporter: Chen Nan Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Compiling Severity:S2 (Serious)
Version:Mysql Cluster OS:Linux (Redhat Linux 8.0)
Assigned to: CPU Architecture:Any

[4 Aug 2004 6:09] Chen Nan
Description:
I builded Mysql Cluster In mysql machine.
And find the follow error:

[root@localhost mysql-4.1]# make test
cd mysql-test ; ./mysql-test-run
Installing Test Databases
Removing Stale Files
Installing Master Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/master-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Installing Slave Databases
running  ../sql/mysqld --no-defaults --bootstrap --skip-grant-tables     --basedir=. --datadir=./var/slave-data --skip-innodb --skip-ndbcluster --skip-bdb     --language=../sql/share/english/ --character-sets-dir=../sql/share/charsets/
Manager disabled, skipping manager start.
Loading Standard Test Databases
Starting Tests

 TEST                           RESULT
------------------------------------------
alias                          [ pass ]
alter_table                    [ pass ]
analyse                        [ pass ]
ansi                           [ pass ]
archive                        [ skipped ]
auto_increment                 [ pass ]
backup                         [ pass ]
bdb-alter-table-1              [ pass ]
bdb-alter-table-2              [ pass ]
bdb-crash                      [ pass ]
bdb-deadlock                   [ pass ]
bdb                            [ pass ]
bdb_cache                      [ pass ]
bench_count_distinct           [ pass ]
bigint                         [ pass ]
binary                         [ pass ]
bool                           [ pass ]
bulk_replace                   [ pass ]
case                           [ pass ]
cast                           [ pass ]
check                          [ pass ]
comments                       [ pass ]
compare                        [ pass ]
connect                        [ pass ]
constraints                    [ pass ]
count_distinct                 [ pass ]
count_distinct2                [ pass ]
count_distinct3                [ pass ]
create                         [ pass ]
create_select_tmp              [ pass ]
ctype_big5                     [ pass ]
ctype_collate                  [ pass ]
ctype_cp1251                   [ pass ]
ctype_create                   [ pass ]
ctype_latin1                   [ pass ]
ctype_latin1_de                [ pass ]
ctype_many                     [ pass ]
ctype_mb                       [ pass ]
ctype_recoding                 [ pass ]
ctype_sjis                     [ pass ]
ctype_tis620                   [ pass ]
ctype_uca                      [ pass ]
ctype_ucs                      [ pass ]
ctype_ujis                     [ pass ]
ctype_utf8                     [ pass ]
date_formats                   [ pass ]
delayed                        [ pass ]
delete                         [ pass ]
derived                        [ pass ]
dirty_close                    [ pass ]
distinct                       [ pass ]
drop                           [ pass ]
drop_temp_table                [ pass ]
empty_table                    [ pass ]
endspace                       [ pass ]
errors                         [ pass ]
explain                        [ pass ]
flush                          [ pass ]
flush_table                    [ pass ]
foreign_key                    [ pass ]
fulltext                       [ pass ]
fulltext2                      [ pass ]
fulltext_cache                 [ pass ]
fulltext_distinct              [ pass ]
fulltext_left_join             [ pass ]
fulltext_multi                 [ pass ]
fulltext_order_by              [ pass ]
fulltext_update                [ pass ]
fulltext_var                   [ pass ]
func_compress                  [ pass ]
func_concat                    [ pass ]
func_crypt                     [ pass ]
func_date_add                  [ pass ]
func_default                   [ pass ]
func_encrypt                   [ pass ]
func_equal                     [ pass ]
func_gconcat                   [ pass ]
func_group                     [ pass ]
func_if                        [ pass ]
func_in                        [ pass ]
func_isnull                    [ pass ]
func_like                      [ pass ]
func_math                      [ pass ]
func_misc                      [ pass ]
func_op                        [ pass ]
func_regexp                    [ pass ]
func_sapdb                     [ pass ]
func_set                       [ pass ]
func_str                       [ pass ]
func_system                    [ pass ]
func_test                      [ pass ]
func_time                      [ pass ]
func_timestamp                 [ pass ]
gcc296                         [ pass ]
gis-rtree                      [ pass ]
gis                            [ pass ]
grant                          [ pass ]
grant2                         [ pass ]
grant_cache                    [ fail ]

Errors are (from /home/chen/mysql/Cluster/mysql-4.1/mysql-test/var/log/mysqltest-time) :
/home/chen/mysql/Cluster/mysql-4.1/client/.libs/mysqltest: At line 145: Result length mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/grant_cache.result        2004-08-03 12:06:12.000000000 +0300
--- r/grant_cache.reject        2004-08-04 06:40:22.000000000 +0300
***************
*** 112,119 ****
  Variable_name Value
  Qcache_not_cached     1
  show grants for current_user();
! Grants for @localhost
! GRANT USAGE ON *.* TO ''@'localhost'
  select "user2";
  user2
  user2
--- 112,119 ----
  Variable_name Value
  Qcache_not_cached     1
  show grants for current_user();
! Grants for root@localhost
! GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
  select "user2";
  user2
  user2
-------------------------------------------------------
Please follow the instructions outlined at
http://www.mysql.com/doc/en/Reporting_mysqltest_bugs.html
to find the reason to this problem and how to report this.

Aborting: grant_cache failed. To continue, re-run with '--force'.

Ending Tests
Shutting-down MySQL daemon

Master shutdown finished
Slave shutdown finished
make: *** [test] Error 1

I Run mysqlbug . The result is:

SEND-PR: -*- send-pr -*-
SEND-PR: Lines starting with `SEND-PR' will be removed automatically, as
SEND-PR: will all comments (text enclosed in `<' and `>').
SEND-PR:
From: root
To: mysql@lists.mysql.com
Subject: [50 character or so descriptive subject here (for reference)]

>Description:
        <precise description of the problem (multiple lines)>
>How-To-Repeat:
        <code/input/activities to reproduce the problem (multiple lines)>
>Fix:
        <how to correct or work around the problem, if known (multiple lines)>

>Submitter-Id:  <submitter ID>
>Originator:    root
>Organization:
 <organization of PR author (multiple lines)>
>MySQL support: [none | licence | email support | extended email support ]
>Synopsis:      <synopsis of the problem (one line)>
>Severity:      <[ non-critical | serious | critical ] (one line)>
>Priority:      <[ low | medium | high ] (one line)>
>Category:      mysql
>Class:         <[ sw-bug | doc-bug | change-request | support ] (one line)>
>Release:       mysql-4.1.4-beta (Source distribution)

>C compiler:    gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
>C++ compiler:  gcc (GCC) 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
>Environment:
        <machine, os, target, libraries (multiple lines)>
System: Linux localhost.localdomain 2.4.18-14 #1 Wed Sep 4 13:35:50 EDT 2002 i686 i686 i386 GNU/Linux
Architecture: i686

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/3.2/specs
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --enable-threads=posi\
x --disable-checking --host=i386-redhat-linux --with-system-zlib --enable-__cxa_atexit
Thread model: posix
gcc version 3.2 20020903 (Red Hat Linux 8.0 3.2-7)
Compilation info: CC='gcc'  CFLAGS='-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparenth\
eses -Wsign-compare -Wwrite-strings -Wunused -mcpu=pentiumpro -O3 -fno-omit-frame-pointer -g'  CXX='gcc'  CXXFLAGS='-Wimplicit -Wre\
turn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverloaded-vi\
rtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -mcpu=pentiumpro\
 -O3 -fno-omit-frame-pointer -g'  LDFLAGS=''  ASFLAGS=''
 LIBC:
lrwxrwxrwx    1 root     root           14  8&#26376;  2 23:58 /lib/libc.so.6 -> libc-2.2.93.so
-rwxr-xr-x    2 root     root      1235468  9&#26376;  6  2002 /lib/libc-2.2.93.so
-rw-r--r--    1 root     root      2233342  9&#26376;  6  2002 /usr/lib/libc.a
-rw-r--r--    1 root     root          178  9&#26376;  6  2002 /usr/lib/libc.so
Configure command: ./configure '--prefix=/usr/local/mysql' '--enable-assembler' '--with-extra-charsets=complex' '--with-readline' '\
--with-innodb' '--with-berkeley-db' '--with-embedded-server' '--enable-thread-safe-client' '--with-openssl' '--with-vio' '--with-ra\
id' '--with-ndbcluster' '--enable-local-infile' 'CFLAGS=-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscript\
s -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Wunused -mcpu=pentiumpro -O3 -fno-omit-frame-pointer -g' 'CXXFLAGS=-Wimpli\
cit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wchar-subscripts -Wformat -Wparentheses -Wsign-compare -Wwrite-strings -Woverl\
oaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor -felide-constructors -fno-exceptions -fno-rtti -mcpu=pe\
ntiumpro -O3 -fno-omit-frame-pointer -g' 'CXX=gcc'

And the "grand_cache.result" is :
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
reset query cache;
flush status;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
create table mysqltest.t2 (a int,b int,c int);
insert into mysqltest.t1 values (1,1,1),(2,2,2);
insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
a
test.t1
select * from t1;
a	b	c
1	1	1
2	2	2
select a from t1;
a
1
2
select c from t1;
c
1
2
select * from t2;
a	b	c
3	3	3
select * from mysqltest.t1,test.t1;
a	b	c	a
1	1	1	test.t1
2	2	2	test.t1
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits%";
Variable_name	Value
Qcache_hits	0
grant SELECT on mysqltest.* to mysqltest_1@localhost;
grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	0
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	0
select "user1";
user1
user1
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	0
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
select * from t1;
a	b	c
1	1	1
2	2	2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	1
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
select a from t1 ;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	2
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
select c from t1;
c
1
2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	3
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
show grants for current_user();
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
select "user2";
user2
user2
select * from t1;
a	b	c
1	1	1
2	2	2
select a from t1;
a
1
2
select c from t1;
c
1
2
select * from mysqltest.t1,test.t1;
a	b	c	a
1	1	1	test.t1
2	2	2	test.t1
select * from t2;
ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2'
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	2
select "user3";
user3
user3
select * from t1;
ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
select a from t1;
a
1
2
select c from t1;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
select * from t2;
ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2'
select mysqltest.t1.c from test.t1,mysqltest.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	7
select "user4";
user4
user4
show grants;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
select a from t1;
ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
a	b	c	a
1	1	1	test.t1
2	2	2	test.t1
select a from mysqltest.t1;
a
1
2
select a from mysqltest.t1;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	8
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	8
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	8
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
flush privileges;
drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;

the "grand_cache.reject" is:
drop table if exists test.t1,mysqltest.t1,mysqltest.t2;
drop database if exists mysqltest;
reset query cache;
flush status;
show grants for current_user;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
show grants;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
create database if not exists mysqltest;
create table mysqltest.t1 (a int,b int,c int);
create table mysqltest.t2 (a int,b int,c int);
insert into mysqltest.t1 values (1,1,1),(2,2,2);
insert into mysqltest.t2 values (3,3,3);
create table test.t1 (a char (10));
insert into test.t1 values ("test.t1");
select * from t1;
a
test.t1
select * from t1;
a	b	c
1	1	1
2	2	2
select a from t1;
a
1
2
select c from t1;
c
1
2
select * from t2;
a	b	c
3	3	3
select * from mysqltest.t1,test.t1;
a	b	c	a
1	1	1	test.t1
2	2	2	test.t1
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits%";
Variable_name	Value
Qcache_hits	0
grant SELECT on mysqltest.* to mysqltest_1@localhost;
grant SELECT on mysqltest.t1 to mysqltest_2@localhost;
grant SELECT on test.t1 to mysqltest_2@localhost;
grant SELECT(a) on mysqltest.t1 to mysqltest_3@localhost;
show grants for current_user();
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	0
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	0
select "user1";
user1
user1
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	0
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
select * from t1;
a	b	c
1	1	1
2	2	2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	1
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
select a from t1 ;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	2
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
select c from t1;
c
1
2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	3
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	1
show grants for current_user();
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
select "user2";
user2
user2
select * from t1;
a	b	c
1	1	1
2	2	2
select a from t1;
a
1
2
select c from t1;
c
1
2
select * from mysqltest.t1,test.t1;
a	b	c	a
1	1	1	test.t1
2	2	2	test.t1
select * from t2;
ERROR 42000: select command denied to user 'mysqltest_2'@'localhost' for table 't2'
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	2
select "user3";
user3
user3
select * from t1;
ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for column 'b' in table 't1'
select a from t1;
a
1
2
select c from t1;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
select * from t2;
ERROR 42000: select command denied to user 'mysqltest_3'@'localhost' for table 't2'
select mysqltest.t1.c from test.t1,mysqltest.t1;
ERROR 42000: SELECT command denied to user 'mysqltest_3'@'localhost' for column 'c' in table 't1'
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	6
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	7
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	7
select "user4";
user4
user4
show grants;
Grants for mysqltest_1@localhost
GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost'
GRANT SELECT ON `mysqltest`.* TO 'mysqltest_1'@'localhost'
select a from t1;
ERROR 3D000: No database selected
select * from mysqltest.t1,test.t1;
a	b	c	a
1	1	1	test.t1
2	2	2	test.t1
select a from mysqltest.t1;
a
1
2
select a from mysqltest.t1;
a
1
2
show status like "Qcache_queries_in_cache";
Variable_name	Value
Qcache_queries_in_cache	8
show status like "Qcache_hits";
Variable_name	Value
Qcache_hits	8
show status like "Qcache_not_cached";
Variable_name	Value
Qcache_not_cached	8
set names binary;
delete from mysql.user where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.db where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.tables_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
delete from mysql.columns_priv where user in ("mysqltest_1","mysqltest_2","mysqltest_3");
flush privileges;
drop table test.t1,mysqltest.t1,mysqltest.t2;
drop database mysqltest;

How to repeat:
??

Suggested fix:
??
[13 Aug 2004 22:31] Hartmut Holzgraefe
duplicate of bug #4678 which is already fixed