mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	When a wildcard database name is given the mysqlshow, but that wildcard matches one database *exactly* (it contains the wildcard character), we list the contents of that database instead of just listing the database name as matching the wildcard. Probably the most common instance of users encountering this behavior would be with "mysqlshow information_schema". client/mysqlshow.c: Add special handling for listing a single database that has a name that looked like it contained wildcards. In this case, we just go ahead and list the contents of the database, since there is a very high probability that is what the user really wanted to do. (For example, 'mysqlshow INFORMATION_SCHEMA' will show the I_S tables instead of just the I_S database.) mysql-test/r/mysqlshow.result: Add new results mysql-test/t/mysqlshow.test: Add new regression test
		
			
				
	
	
		
			127 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			127 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| DROP TABLE IF EXISTS t1,t2,test1,test2;
 | |
| CREATE TABLE t1 (a int);
 | |
| INSERT INTO t1 VALUES (1),(2),(3);
 | |
| CREATE TABLE t2 (a int, b int);
 | |
| show tables;
 | |
| Tables_in_test
 | |
| t1
 | |
| t2
 | |
| select "--------------------" as "";
 | |
| 
 | |
| --------------------
 | |
| Database: test
 | |
| +--------+
 | |
| | Tables |
 | |
| +--------+
 | |
| | t1     |
 | |
| | t2     |
 | |
| +--------+
 | |
| select "---- -v ------------" as "";
 | |
| 
 | |
| ---- -v ------------
 | |
| Database: test
 | |
| +--------+----------+
 | |
| | Tables | Columns  |
 | |
| +--------+----------+
 | |
| | t1     |        1 |
 | |
| | t2     |        2 |
 | |
| +--------+----------+
 | |
| 2 rows in set.
 | |
| 
 | |
| select "---- -v -v ---------" as "";
 | |
| 
 | |
| ---- -v -v ---------
 | |
| Database: test
 | |
| +--------+----------+------------+
 | |
| | Tables | Columns  | Total Rows |
 | |
| +--------+----------+------------+
 | |
| | t1     |        1 |          3 |
 | |
| | t2     |        2 |          0 |
 | |
| +--------+----------+------------+
 | |
| 2 rows in set.
 | |
| 
 | |
| select "----- -t -----------" as "";
 | |
| 
 | |
| ----- -t -----------
 | |
| Database: test
 | |
| +--------+------------+
 | |
| | Tables | table_type |
 | |
| +--------+------------+
 | |
| | t1     | BASE TABLE |
 | |
| | t2     | BASE TABLE |
 | |
| +--------+------------+
 | |
| select "---- -v -t ---------" as "";
 | |
| 
 | |
| ---- -v -t ---------
 | |
| Database: test
 | |
| +--------+------------+----------+
 | |
| | Tables | table_type | Columns  |
 | |
| +--------+------------+----------+
 | |
| | t1     | BASE TABLE |        1 |
 | |
| | t2     | BASE TABLE |        2 |
 | |
| +--------+------------+----------+
 | |
| 2 rows in set.
 | |
| 
 | |
| select "---- -v -v -t ------" as "";
 | |
| 
 | |
| ---- -v -v -t ------
 | |
| Database: test
 | |
| +--------+------------+----------+------------+
 | |
| | Tables | table_type | Columns  | Total Rows |
 | |
| +--------+------------+----------+------------+
 | |
| | t1     | BASE TABLE |        1 |          3 |
 | |
| | t2     | BASE TABLE |        2 |          0 |
 | |
| +--------+------------+----------+------------+
 | |
| 2 rows in set.
 | |
| 
 | |
| DROP TABLE t1, t2;
 | |
| Database: information_schema
 | |
| +---------------------------------------+
 | |
| |                Tables                 |
 | |
| +---------------------------------------+
 | |
| | CHARACTER_SETS                        |
 | |
| | COLLATIONS                            |
 | |
| | COLLATION_CHARACTER_SET_APPLICABILITY |
 | |
| | COLUMNS                               |
 | |
| | COLUMN_PRIVILEGES                     |
 | |
| | KEY_COLUMN_USAGE                      |
 | |
| | ROUTINES                              |
 | |
| | SCHEMATA                              |
 | |
| | SCHEMA_PRIVILEGES                     |
 | |
| | STATISTICS                            |
 | |
| | TABLES                                |
 | |
| | TABLE_CONSTRAINTS                     |
 | |
| | TABLE_PRIVILEGES                      |
 | |
| | TRIGGERS                              |
 | |
| | USER_PRIVILEGES                       |
 | |
| | VIEWS                                 |
 | |
| +---------------------------------------+
 | |
| Database: INFORMATION_SCHEMA
 | |
| +---------------------------------------+
 | |
| |                Tables                 |
 | |
| +---------------------------------------+
 | |
| | CHARACTER_SETS                        |
 | |
| | COLLATIONS                            |
 | |
| | COLLATION_CHARACTER_SET_APPLICABILITY |
 | |
| | COLUMNS                               |
 | |
| | COLUMN_PRIVILEGES                     |
 | |
| | KEY_COLUMN_USAGE                      |
 | |
| | ROUTINES                              |
 | |
| | SCHEMATA                              |
 | |
| | SCHEMA_PRIVILEGES                     |
 | |
| | STATISTICS                            |
 | |
| | TABLES                                |
 | |
| | TABLE_CONSTRAINTS                     |
 | |
| | TABLE_PRIVILEGES                      |
 | |
| | TRIGGERS                              |
 | |
| | USER_PRIVILEGES                       |
 | |
| | VIEWS                                 |
 | |
| +---------------------------------------+
 | |
| Wildcard: inf_rmation_schema
 | |
| +--------------------+
 | |
| |     Databases      |
 | |
| +--------------------+
 | |
| | information_schema |
 | |
| +--------------------+
 | |
| End of 5.0 tests
 |