Commit 3eda70b2 authored by unknown's avatar unknown
Browse files

Fixes during review of new pushed code

Fixed new bug when running a SP without a default database


mysql-test/r/information_schema.result:
  Added test to cover changes made in default handling
mysql-test/r/sp-security.result:
  Added test when executing SP without a default database
mysql-test/t/information_schema.test:
  Added test to cover changes made in default handling
mysql-test/t/sp-security.test:
  Added test when executing SP without a default database
sql/item_strfunc.cc:
  Removed wrong push
sql/mysqld.cc:
  Indentation fix
sql/sql_base.cc:
  Use share->db instead of share->table_cache_key
  Remove assert that can never fail (because of test in previous row)
sql/sql_db.cc:
  Allow empty database name when called from SP
  (To allow on run without a default database)
sql/sql_parse.cc:
  Added comment
sql/sql_show.cc:
  Indentation fixes
  Simplified code by checking for 'wrong' condition first and doing continue instead of going down one level
  Simplified precision and decimal handling
parent 4d2bf4be
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -966,4 +966,8 @@ column_name column_default
a	NULL
b	NULL
use test;
show columns from t1;
Field	Type	Null	Key	Default	Extra
a	int(11)	NO			
b	int(11)	YES		NULL	
drop table t1;
+2 −0
Original line number Diff line number Diff line
@@ -245,6 +245,8 @@ end//
grant usage on *.* to mysqltest_1@localhost;
call mysqltest_1.p1();
ERROR 42000: execute command denied to user 'mysqltest_1'@'localhost' for routine 'mysqltest_1.p1'
call mysqltest_1.p1();
ERROR 42000: execute command denied to user 'mysqltest_1'@'localhost' for routine 'mysqltest_1.p1'
drop procedure mysqltest_1.p1;
drop database mysqltest_1;
revoke usage on *.* from mysqltest_1@localhost;
+1 −0
Original line number Diff line number Diff line
@@ -649,4 +649,5 @@ use information_schema;
select column_name, column_default from columns
  where table_schema='test' and table_name='t1';
use test;
show columns from t1;
drop table t1;
+6 −0
Original line number Diff line number Diff line
@@ -397,6 +397,12 @@ connection n1;
--error 1370
call mysqltest_1.p1();
disconnect n1;
# Test also without a current database
connect (n2,localhost,mysqltest_1,,*NO-ONE*,$MASTER_MYPORT,$MASTER_MYSOCK);
connection n2;
--error 1370
call mysqltest_1.p1();
disconnect n2;

connection default;

+0 −3
Original line number Diff line number Diff line
@@ -2176,9 +2176,6 @@ void Item_func_lpad::fix_length_and_dec()
  {
    ulonglong length= ((ulonglong) args[1]->val_int() *
                       collation.collation->mbmaxlen);
    /*a comment before (merged) */
    length= max((ulonglong)args[0]->max_length, length);
    /*a comment after */
    if (length >= MAX_BLOB_WIDTH)
    {
      length= MAX_BLOB_WIDTH;
Loading