Bug #25874 Database name missing from SELECT metadata
Submitted: 26 Jan 2007 16:09 Modified: 9 Oct 2007 10:02
Reporter: Paul McCullagh (Basic Quality Contributor) (OCA) Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.15-BK OS:Linux (Linux)
Assigned to: Assigned Account CPU Architecture:Any
Tags: Database name, metadata

[26 Jan 2007 16:09] Paul McCullagh
Description:
The metadata field 'Database' is empty when a SELECT is done using an engine other than MyISAM.

How to repeat:
I used the latest 5.1 BK sources. Execute the following test:

--enable_metadata
create table t1 (id int(10)) engine=innodb;
insert into t1 values (1);
CREATE  VIEW v1 AS select t1.id as id from t1;
select * from v1 group by id limit 1;
--disable_metadata

The output is as follows (the database name 'test' is missing):

create table t1 (id int(10)) engine=innodb;
insert into t1 values (1);
CREATE  VIEW v1 AS select t1.id as id from t1;
select * from v1 group by id limit 1;
Catalog	Database	Table	Table_alias	Column	Column_alias	Type	Length	Max length	Is_null	Flags	Decimals	Charsetnr
def		t1		id	id	3	10	1	Y	32768	0	63
id
1
[26 Jan 2007 16:40] Valeriy Kravchuk
Thank you for a bug report. Verified just as described (with empty .result file) with 5.1.15-BK on Linux:

openxs@suse:~/dbs/5.1/mysql-test> ./mysql-test-run.pl innodb bug25874
Logging: ./mysql-test-run.pl innodb bug25874
MySQL Version 5.1.15
Using binlog format 'mixed'
Using ndbcluster when necessary, mysqld supports it
Skipping SSL, mysqld not compiled with SSL
mysql-test-run: WARNING: Could not find all required ndb binaries, all ndb tests
 will fail, use --skip-ndbcluster to skip testing it.
Using MTR_BUILD_THREAD      = 0
Using MASTER_MYPORT         = 9306
Using MASTER_MYPORT1        = 9307
Using SLAVE_MYPORT          = 9308
Using SLAVE_MYPORT1         = 9309
Using SLAVE_MYPORT2         = 9310
Using NDBCLUSTER_PORT       = 9310
Using NDBCLUSTER_PORT_SLAVE = 9311
Using IM_PORT               = 9312
Using IM_MYSQLD1_PORT       = 9313
Using IM_MYSQLD2_PORT       = 9314
Killing Possible Leftover Processes
Removing Stale Files
Creating Directories
Installing Master Database
Installing Master Database
=======================================================
Starting Tests in the 'main' suite

TEST                           RESULT         TIME (ms)
-------------------------------------------------------

innodb                         [ pass ]          15812
bug25874                       [ fail ]

Errors are (from /home/openxs/dbs/5.1/mysql-test/var/log/mysqltest-time) :
mysqltest: Result length mismatch
(the last lines may be the most important ones)
Below are the diffs between actual and expected results:
-------------------------------------------------------
*** r/bug25874.result   2007-01-26 17:46:13.000000000 +0300
--- r/bug25874.reject   2007-01-26 17:47:53.000000000 +0300
***************
*** 0 ****
--- 1,8 ----
+ create table t1 (id int(10)) engine=innodb;
+ insert into t1 values (1);
+ CREATE  VIEW v1 AS select t1.id as id from t1;
+ select * from v1 group by id limit 1;
+ Catalog       Database        Table   Table_alias     Column  Column_aliasType
        Length  Max length      Is_null Flags   Decimals        Charsetnr
+ def           t1              id      id      3       10      1       Y3276806
3
+ id
+ 1
...

Note that Database field is empty, unlike for MyISAM.
[9 Oct 2007 10:02] Sergey Vojtovich
A duplicate of BUG#28898.