• unknown's avatar
    Fixed BUG#5000: SPs can be created with no default database. · c92b5349
    unknown authored
      Easy to prevent crash, but the question was how to treat this case?
      We ended up implementing the "global" SPs (i.e. with no associated
      db), which were planned but left unresolved when SPs moved into dbs.
      So now things like "call .p()" work too.
    
    
    mysql-test/r/sp-error.result:
      New test case for BUG#5000, and "global" SPs in general.
    mysql-test/t/sp-error.test:
      New test case for BUG#5000, and "global" SPs in general.
    sql/sp.cc:
      Prevent crash when the new db is null.
    sql/sp_head.cc:
      Don't set the db part of the name to thd->db, we have already set it correctly
      in the provided name struct.
      Also, don't attempt to change "no-db" when executing an SP.
    sql/sql_yacc.yy:
      Added support for the "global SP" syntax, e.g ".p()".
    c92b5349
sp-error.result 11.4 KB