diff options
author | unknown <gluh@gluh.mysql.r18.ru> | 2004-12-10 12:07:11 +0300 |
---|---|---|
committer | unknown <gluh@gluh.mysql.r18.ru> | 2004-12-10 12:07:11 +0300 |
commit | c7d7c9ca10b1ee19cb017bfe9bb8b183ef9022a1 (patch) | |
tree | 66e74d7dcaa0816cb4ae36f5ba45e910cdaa6267 /sql/sql_db.cc | |
parent | 6f8ca2513e19db9359c46bc8370f3a8b36d3a5d2 (diff) | |
download | mariadb-git-c7d7c9ca10b1ee19cb017bfe9bb8b183ef9022a1.tar.gz |
Don't display 'usage' privilege in TABLE_PRIVILEGES if we have columns privileges
mysqldump skips information_schema db
'use' now can use information_schema db
changed value of column 'Null' to 'NO' if column is not nullable
client/mysqldump.c:
mysqldump skips information_schema db
mysql-test/r/alter_table.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/create.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/ctype_collate.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/ctype_recoding.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/ctype_ujis.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/drop.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/func_sapdb.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/func_time.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/gis.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/information_schema.result:
Added couple of tests
mysql-test/r/information_schema_inno.result:
Removed coulmn 'CONTRAINT_METOD' from TABLE_CONSTRAINTS
Added column 'POSITION_IN_UNIQUE_CONSTRAINT' to KEY_COLUMN_USAGE
mysql-test/r/innodb.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/ndb_autodiscover.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/ps_1general.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/rpl000009.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/rpl_create_database.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/schema.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/select.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/show_check.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/sp.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/type_enum.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/r/type_ranges.result:
changed value of column 'Null' to 'NO' if column is not nullable
mysql-test/t/information_schema.test:
Added couple of tests
sql/sql_acl.cc:
Don't display 'usage' privilege in TABLE_PRIVILEGES if we have columns privileges
sql/sql_db.cc:
'use' now can use information_schema db
sql/sql_show.cc:
code cleanup
informaton_schema(IS) db now contains data about IS itself
sql/sql_yacc.yy:
A fix(wrong behavour of 'SHOW COLUMNS, SHOW KEYS' with 'where condition')
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r-- | sql/sql_db.cc | 38 |
1 files changed, 32 insertions, 6 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc index 3e606029bec..ea81013a401 100644 --- a/sql/sql_db.cc +++ b/sql/sql_db.cc @@ -389,6 +389,13 @@ bool mysql_create_db(THD *thd, char *db, HA_CREATE_INFO *create_info, uint create_options= create_info ? create_info->options : 0; uint path_len; DBUG_ENTER("mysql_create_db"); + + /* do not create 'information_schema' db */ + if (!my_strcasecmp(system_charset_info, db, information_schema_name.str)) + { + my_error(ER_DB_CREATE_EXISTS, MYF(0), db); + DBUG_RETURN(-1); + } VOID(pthread_mutex_lock(&LOCK_mysql_create_db)); @@ -1015,6 +1022,7 @@ bool mysql_change_db(THD *thd, const char *name) char *dbname=my_strdup((char*) name,MYF(MY_WME)); char path[FN_REFLEN]; HA_CREATE_INFO create; + bool schema_db= 0; #ifndef NO_EMBEDDED_ACCESS_CHECKS ulong db_access; #endif @@ -1034,6 +1042,15 @@ bool mysql_change_db(THD *thd, const char *name) DBUG_RETURN(1); } DBUG_PRINT("info",("Use database: %s", dbname)); + if (!my_strcasecmp(system_charset_info, dbname, information_schema_name.str)) + { + schema_db= 1; +#ifndef NO_EMBEDDED_ACCESS_CHECKS + db_access= SELECT_ACL; +#endif + goto end; + } + #ifndef NO_EMBEDDED_ACCESS_CHECKS if (test_all_bits(thd->master_access,DB_ACLS)) db_access=DB_ACLS; @@ -1064,6 +1081,7 @@ bool mysql_change_db(THD *thd, const char *name) my_free(dbname,MYF(0)); DBUG_RETURN(1); } +end: send_ok(thd); x_free(thd->db); thd->db=dbname; // THD::~THD will free this @@ -1071,11 +1089,19 @@ bool mysql_change_db(THD *thd, const char *name) #ifndef NO_EMBEDDED_ACCESS_CHECKS thd->db_access=db_access; #endif - strmov(path+unpack_dirname(path,path), MY_DB_OPT_FILE); - load_db_opt(thd, path, &create); - thd->db_charset= create.default_table_charset ? - create.default_table_charset : - thd->variables.collation_server; - thd->variables.collation_database= thd->db_charset; + if (schema_db) + { + thd->db_charset= system_charset_info; + thd->variables.collation_database= system_charset_info; + } + else + { + strmov(path+unpack_dirname(path,path), MY_DB_OPT_FILE); + load_db_opt(thd, path, &create); + thd->db_charset= create.default_table_charset ? + create.default_table_charset : + thd->variables.collation_server; + thd->variables.collation_database= thd->db_charset; + } DBUG_RETURN(0); } |