An error occurred fetching the project authors.
  1. 25 Apr, 2007 2 commits
    • unknown's avatar
      Fix test case that was broken for builds without InnoDB. · fedd09cd
      unknown authored
      ```yaml
      Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work-vanilla-building
      into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.1-build-work-vanilla-building
      ```
      
      Fix test cases to pass for a plain ./configure && make build. This includes disabling two test cases when certain features are not present in the server. We're not losing coverage from this because these features are usually present, and disabling them here only serves the purpose to make the test cases work in the unlikely case that they aren't.
      ---
      fixes
      
      
      mysql-test/extra/rpl_tests/rpl_extraSlave_Col.test:
        Disable this test case if we don't have partitioning
      mysql-test/t/rpl_row_basic_11bugs.test:
        Disable warnings in a number of places to make this test case work with servers that don't contain InnoDB
        ---
        make test case look better on request from reviewer
      mysql-test/t/rpl_row_mysqlbinlog.test:
        Disable this test case if the server does not have cp932 compiled in
      mysql-test/t/sp.test:
        Disable warnings during table creation in one place where engine=innodb is used, in order to make this test case work with a mysqld that was compiled without InnoDB.
      fedd09cd
    • unknown's avatar
      Fix test case that was broken for builds without InnoDB. · 24623226
      unknown authored
      mysql-test/t/sp.test:
        Disable warnings during table creation in one place where engine=innodb is used, in order to make this test case work with a mysqld that was compiled without InnoDB.
      24623226
  2. 12 Apr, 2007 1 commit
  3. 03 Apr, 2007 1 commit
  4. 27 Mar, 2007 2 commits
    • unknown's avatar
      Fix for BUG#25082: default database change on trigger · 6a594ffd
      unknown authored
      execution breaks replication.
      
      When a stored routine is executed, we switch current
      database to the database, in which the routine
      has been created. When the stored routine finishes,
      we switch back to the original database.
      
      The problem was that if the original database does not
      exist (anymore) after routine execution, we raised an error.
      
      The fix is to report a warning, and switch to the NULL database.
      
      
      mysql-test/r/sp.result:
        Updated result file.
      mysql-test/t/sp.test:
        Added test case for BUG#25082.
      sql/mysql_priv.h:
        1. Change mysql_change_db() prototype;
        2. Polishing.
      sql/sp.cc:
        Polishing.
      sql/sp_head.cc:
        Polishing.
      sql/sql_db.cc:
        1. Polishing.
        2. Fix mysql_change_db().
      sql/sql_parse.cc:
        Polishing.
      sql/sql_show.cc:
        Polishing.
      6a594ffd
    • unknown's avatar
      Corrected error in test case: · e4dcf4e3
      unknown authored
      - 1.84e+15 converted to unsigned bigint should be
        18400000000000000000 < 18446744073709551615.
      - The test will still fail on windows, and is extracted
        into a new bug report.
      
      
      e4dcf4e3
  5. 22 Mar, 2007 1 commit
    • unknown's avatar
      Bug #27354 stored function in where condition was always treated as const · df3a48ea
      unknown authored
      Possible problems: function call could be eliminated from where class and only
      be evaluated once; function can be evaluated during table and item setup phase which could
      cause side effects not to be registered in binlog.
      
      Fixed with introducing func_item_sp::used_tables() returning the correct table_map constant.
      
      
      
      mysql-test/r/sp.result:
        results changed
      mysql-test/t/sp.test:
        regression test demonstrating that function's returns match where condition
        of the top-level query table.
      sql/item_func.h:
        private used_tables() method returning the correct table_bit with meaning the item is not
        a constant
      df3a48ea
  6. 16 Mar, 2007 1 commit
    • unknown's avatar
      Bug#20777 Function w BIGINT UNSIGNED shows diff. behaviour with and without --ps-protocol · ffc605aa
      unknown authored
      - Stored procedures returning unsinged values returns signed values if
        text protocol is used. The reason is that the stored proceedure item
        Item_func_sp wasn't initializing the member variables properly based
        on the information contained in the associated result field.
      - The patch is to upon field-item association, ::fix_fields, initialize
        the member variables in appropriate order.
      - Field type of an Item_func_sp was hard coded to MYSQL_TYPE_VARCHAR.
        This is changed to return the type of the actual result field.
      - Member function name sp_result_field was refactored to the more 
        appropriate init_result_field.
      - Member function name find_and_check_access was refactored to 
        sp_check_access.
      
      
      mysql-test/r/sp.result:
        - Added test
      mysql-test/t/sp.test:
        - Added test
      sql/item_func.cc:
        Bug#20777 Function w BIGINT UNSIGNED shows diff. behaviour with and without --ps-protocol
        
        - Stored procedures returning unsinged values returns signed values if
          text protocol is used. The reason is that the stored proceedure item
          Item_func_sp wasn't initializing the member variables properly based
          on the information contained in the associated result field.
        - The patch is to upon field-item association, ::fix_fields, initialize
          the member variables in appropriate order.
        - Field type of an Item_func_sp was hard coded to MYSQL_TYPE_VARCHAR.
          This is changed to to return the type of the actual result field.
        - Member function name sp_result_field was refactored to the more 
          appropriate init_result_field.
        - Member function name find_and_check_access was refactored to 
          sp_check_access.
      sql/item_func.h:
        Bug#20777 Function w BIGINT UNSIGNED shows diff. behaviour with and without --ps-protocol
        
        - Stored procedures returning unsinged values returns signed values if
          text protocol is used. The reason is that the stored proceedure item
          Item_func_sp wasn't initializing the member variables properly based
          on the information contained in the associated result field.
        - The patch is to upon field-item association, ::fix_fields, initialize
          the member variables in appropriate order.
        - Field type of an Item_func_sp was hard coded to MYSQL_TYPE_VARCHAR.
          This is changed to to return the type of the actual result field.
        - Member function name sp_result_field was refactored to the more 
          appropriate init_result_field.
        - Member function name find_and_check_access was refactored to 
          sp_check_access.
      ffc605aa
  7. 14 Mar, 2007 2 commits
    • unknown's avatar
      Manual merge from 5.0-runtime to 5.1-runtime · 2fad8ac2
      unknown authored
      2fad8ac2
    • unknown's avatar
      Bug#26503 (Illegal SQL exception handler code causes the server to crash) · 79344c7b
      unknown authored
      Before this fix, the parser would accept illegal code in SQL exceptions
      handlers, that later causes the runtime to crash when executing the code,
      due to memory violations in the exception handler stack.
      
      The root cause of the problem is instructions within an exception handler
      that jumps to code located outside of the handler. This is illegal according
      to the SQL 2003 standard, since labels located outside the handler are not
      supposed to be visible (they are "out of scope"), so any instruction that
      jumps to these labels, like ITERATE or LEAVE, should not parse.
      
      The section of the standard that is relevant for this is :
        SQL:2003 SQL/PSM (ISO/IEC 9075-4:2003)
        section 13.1 <compound statement>,
        syntax rule 4
      <quote>
        The scope of the <beginning label> is CS excluding every <SQL schema
        statement> contained in CS and excluding every
        <local handler declaration list> contained in CS. <beginning label> shall
        not be equivalent to any other <beginning label>s within that scope.
      </quote>
      
      With this fix, the C++ class sp_pcontext, which represent the "parsing
      context" tree (a.k.a symbol table) of a stored procedure, has been changed
      as follows:
      - constructors have been cleaned up, so that only building a root node for
      the tree is public; building nodes inside a tree is not public.
      - a new member, m_label_scope, indicates if a given syntactic context
      belongs to a DECLARE HANDLER block,
      - label resolution, in the method find_label(), has been changed to
      implement the restriction of scope regarding labels used in a compound
      statement.
      
      The actions in the parser, when parsing the body of a SQL exception handler,
      have been changed as follows:
      - the implementation of an exception handler (DECLARE HANDLER) now creates
      explicitly a new sp_pcontext, to isolate the code inside the handler from
      the containing compound statement context.
      - registering exception handlers as a result occurs in the parent context,
      see the rule sp_hcond_element
      - the code in sp_hcond_list has been cleaned up, to avoid code duplication
      
      In addition, the flags IN_SIMPLE_CASE and IN_HANDLER, declared in sp_head.h
      have been removed, since they are unused and broken by design (as seen with
      Bug 19194 (Right recursion in parser for CASE causes excessive stack usage,
      limitation), representing a stack in a single flag is not possible.
      
      Tests in sp-error have been added to show that illegal constructs are now
      rejected.
      
      Tests in sp have been added for code coverage, to show that ITERATE or LEAVE
      statements are legal when jumping to a label in scope, inside the body of
      an exception handler.
      
      
      mysql-test/r/sp-error.result:
        SQL Exception handlers define a parsing context for label resolution.
      mysql-test/r/sp.result:
        SQL Exception handlers define a parsing context for label resolution.
      mysql-test/t/sp-error.test:
        SQL Exception handlers define a parsing context for label resolution.
      mysql-test/t/sp.test:
        SQL Exception handlers define a parsing context for label resolution.
      sql/sp_head.cc:
        Minor cleanup
      sql/sp_head.h:
        Minor cleanup
      sql/sp_pcontext.cc:
        SQL Exception handlers define a parsing context for label resolution.
      sql/sp_pcontext.h:
        SQL Exception handlers define a parsing context for label resolution.
      sql/sql_yacc.yy:
        SQL Exception handlers define a parsing context for label resolution.
      79344c7b
  8. 07 Mar, 2007 1 commit
    • unknown's avatar
      Bug#25373: Stored functions wasn't compared correctly which leads to a wrong · 11b533b8
      unknown authored
      result.
      
      For built-in functions like sqrt() function names are hard-coded and can be
      compared by pointer. But this isn't the case for a used-defined stored
      functions - names there are dynamical and should be compared as strings.
      
      Now the Item_func::eq() function employs my_strcasecmp() function to compare
      used-defined stored functions names.
      
      
      mysql-test/t/sp.test:
        Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result.
      mysql-test/r/sp.result:
        Added a test case for bug#25373: Stored functions wasn't compared correctly which leads to a wrong result.
      sql/item_func.cc:
        Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
        result.
        Now the Item_func::eq() function employs my_strcasecmp() function to compare
        used-defined stored functions names.
      11b533b8
  9. 06 Mar, 2007 1 commit
    • unknown's avatar
      Bug#8407 (Stored functions/triggers ignore exception handler) · 266a7fff
      unknown authored
      Bug 18914 (Calling certain SPs from triggers fail)
      Bug 20713 (Functions will not not continue for SQLSTATE VALUE '42S02')
      Bug 21825 (Incorrect message error deleting records in a table with a
        trigger for inserting)
      Bug 22580 (DROP TABLE in nested stored procedure causes strange dependency
        error)
      Bug 25345 (Cursors from Functions)
      
      
      This fix resolves a long standing issue originally reported with bug 8407,
      which affect the behavior of Stored Procedures, Stored Functions and Trigger
      in many different ways, causing symptoms reported by all the bugs listed.
      In all cases, the root cause of the problem traces back to 8407 and how the
      server locks tables involved with sub statements.
      
      Prior to this fix, the implementation of stored routines would:
      - compute the transitive closure of all the tables referenced by a top level
      statement
      - open and lock all the tables involved
      - execute the top level statement
      "transitive closure of tables" means collecting:
      - all the tables,
      - all the stored functions,
      - all the views,
      - all the table triggers
      - all the stored procedures
      involved, and recursively inspect these objects definition to find more
      references to more objects, until the list of every object referenced does
      not grow any more.
      This mechanism is known as "pre-locking" tables before execution.
      The motivation for locking all the tables (possibly) used at once is to
      prevent dead locks.
      
      One problem with this approach is that, if the execution path the code
      really takes during runtime does not use a given table, and if the table is
      missing, the server would not execute the statement.
      This in particular has a major impact on triggers, since a missing table
      referenced by an update/delete trigger would prevent an insert trigger to run.
      
      Another problem is that stored routines might define SQL exception handlers
      to deal with missing tables, but the server implementation would never give
      user code a chance to execute this logic, since the routine is never
      executed when a missing table cause the pre-locking code to fail.
      
      With this fix, the internal implementation of the pre-locking code has been
      relaxed of some constraints, so that failure to open a table does not
      necessarily prevent execution of a stored routine.
      
      In particular, the pre-locking mechanism is now behaving as follows:
      
      1) the first step, to compute the transitive closure of all the tables
      possibly referenced by a statement, is unchanged.
      
      2) the next step, which is to open all the tables involved, only attempts
      to open the tables added by the pre-locking code, but silently fails without
      reporting any error or invoking any exception handler is the table is not
      present. This is achieved by trapping internal errors with
      Prelock_error_handler
      
      3) the locking step only locks tables that were successfully opened.
      
      4) when executing sub statements, the list of tables used by each statements
      is evaluated as before. The tables needed by the sub statement are expected
      to be already opened and locked. Statement referencing tables that were not
      opened in step 2) will fail to find the table in the open list, and only at
      this point will execution of the user code fail.
      
      5) when a runtime exception is raised at 4), the instruction continuation
      destination (the next instruction to execute in case of SQL continue
      handlers) is evaluated.
      This is achieved with sp_instr::exec_open_and_lock_tables()
      
      6) if a user exception handler is present in the stored routine, that
      handler is invoked as usual, so that ER_NO_SUCH_TABLE exceptions can be
      trapped by stored routines. If no handler exists, then the runtime execution
      will fail as expected.
      
      With all these changes, a side effect is that view security is impacted, in
      two different ways.
      
      First, a view defined as "select stored_function()", where the stored
      function references a table that may not exist, is considered valid.
      The rationale is that, because the stored function might trap exceptions
      during execution and still return a valid result, there is no way to decide
      when the view is created if a missing table really cause the view to be invalid.
      
      Secondly, testing for existence of tables is now done later during
      execution. View security, which consist of trapping errors and return a
      generic ER_VIEW_INVALID (to prevent disclosing information) was only
      implemented at very specific phases covering *opening* tables, but not
      covering the runtime execution. Because of this existing limitation,
      errors that were previously trapped and converted into ER_VIEW_INVALID are
      not trapped, causing table names to be reported to the user.
      This change is exposing an existing problem, which is independent and will
      be resolved separately.
      
      
      mysql-test/r/information_schema_db.result:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/r/sp-error.result:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/r/sp.result:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/r/trigger.result:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/r/view.result:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/t/sp-error.test:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/t/sp.test:
        Revised the pre-locking code implementation, aligned the tests.
      mysql-test/t/trigger.test:
        Revised the pre-locking code implementation, aligned the tests.
      sql/lock.cc:
        table->placeholder now checks for schema_table
      sql/mysqld.cc:
        my_message_sql(): invoke internal exception handlers
      sql/sp_head.cc:
        exec_open_and_lock_tables(): open and lock tables, or return the
        continuation destination of this instruction
      sql/sp_head.h:
        exec_open_and_lock_tables(): open and lock tables, or return the
        continuation destination of this instruction
      sql/sql_base.cc:
        Prelock_error_handler: delay open table errors until execution
      sql/sql_class.cc:
        THD: add internal error handler, as an exception mechanism.
      sql/sql_class.h:
        THD: add internal error handler, as an exception mechanism.
      sql/sql_update.cc:
        table->placeholder now checks for schema_table
      sql/table.cc:
        st_table_list::hide_view_error(): masked more errors for view security
      sql/table.h:
        table->placeholder now checks for schema_table, and unopened tables
      266a7fff
  10. 01 Mar, 2007 1 commit
    • unknown's avatar
      Make sure tests drops objects created and restore variables to default · 245b9ad4
      unknown authored
      mysql-test/extra/rpl_tests/rpl_row_func003.test:
        Fix spelling error
      mysql-test/extra/rpl_tests/rpl_row_tabledefs.test:
        Restore sql_mode after test
      mysql-test/r/events_logs_tests.result:
        Turn even_scheduleroff before test ends
      mysql-test/r/events_scheduling.result:
        Turn even_scheduleroff before test ends
      mysql-test/r/insert.result:
        Drop tables t1 before test ends
      mysql-test/r/rpl_read_only.result:
        Set read_only flag back to default
      mysql-test/r/rpl_row_NOW.result:
        Drop database mysqltest1 before test ends
      mysql-test/r/rpl_row_USER.result:
        Drop users created by test
      mysql-test/r/rpl_row_basic_11bugs.result:
        Drop table and set query_cache_size back to default
      mysql-test/r/rpl_row_func002.result:
        Drop table created by test
      mysql-test/r/rpl_row_sp008.result:
        Drop table created by test
      mysql-test/r/rpl_row_sp012.result:
        Drop user created by test
      mysql-test/r/rpl_row_tabledefs_2myisam.result:
        Restore sql_mode
      mysql-test/r/rpl_row_tabledefs_3innodb.result:
        Restore sql_mode
      mysql-test/r/rpl_row_tabledefs_7ndb.result:
        Restore sql_mode
      mysql-test/r/rpl_row_view01.result:
        Drop database created by test
      mysql-test/r/rpl_slave_status.result:
        Remove created users
      mysql-test/r/rpl_switch_stm_row_mixed.result:
        Reset binlog_format to default
      mysql-test/r/sp.result:
        Drop procedure created by test
      mysql-test/r/varbinary.result:
        Drop table created by test
      mysql-test/r/variables.result:
        Reset changed variables to their defaults
      mysql-test/t/events_logs_tests.test:
        Turn off event_scheduler before test ends
      mysql-test/t/events_scheduling.test:
        Turn off event_scheduler
      mysql-test/t/insert.test:
        Drop table created by test
      mysql-test/t/rpl_read_only.test:
        Reset read_only flag
      mysql-test/t/rpl_row_NOW.test:
        Drop db created by test
      mysql-test/t/rpl_row_USER.test:
        Drop users created
      mysql-test/t/rpl_row_basic_11bugs.test:
        Drop tables created by test
      mysql-test/t/rpl_row_func002.test:
        Drop table created by test
      mysql-test/t/rpl_row_sp008.test:
        Drop table created by test
      mysql-test/t/rpl_row_sp012.test:
        Drop user created by test
      mysql-test/t/rpl_row_view01.test:
        Drop db created by test
      mysql-test/t/rpl_slave_status.test:
        Remove users created by test
      mysql-test/t/rpl_switch_stm_row_mixed.test:
        Reset binlog_format
      mysql-test/t/sp.test:
        Drop procedure created by test
      mysql-test/t/varbinary.test:
        Drop tables created by test
      mysql-test/t/variables.test:
        Restore variables to their default before test ends
      245b9ad4
  11. 19 Feb, 2007 1 commit
    • unknown's avatar
      Bug#18743: Several test cases fails if "classic" configuration in 5.0 · db36a2aa
      unknown authored
      The problem happened because those tests were using "cp932" and "ucs2" without checking whether these character sets are available. This fix moves test parts to make character set specific parts be tested only if they are:
      - some parts were moved to "ctype_ucs.test" and "ctype_cp932.test"
      - some parts were moved to the newly added tests "innodb-ucs2.test", "mysqlbinglog-cp932.test" and "sp-ucs2.test"
      
      
      mysql-test/r/ctype_cp932.result:
        Moved cp932-specific test case from mysql.test
      mysql-test/r/innodb.result:
        Moved ucs2-specific test cases to innodb-ucs2.test
      mysql-test/r/mysql.result:
        Move cp932-specific test cases to ctype_cp932.test
      mysql-test/r/mysqlbinlog.result:
        Moved cp932-specific test case to mysqlbinlog-cp932.test
      mysql-test/r/sp.result:
        Moved ucs2-specific test case to sp-ucs2.test
      mysql-test/t/ctype_cp932.test:
        Moved cp932-specific test case from mysql.test
      mysql-test/t/ctype_ucs2_def-master.opt:
        Use the comma-separated list of character sets to avoid mysql-test errors when ucs2 is not available in the server
      mysql-test/t/ctype_ucs2_def.test:
        Added requirement for ucs2 in the server
      mysql-test/t/innodb.test:
        Moved ucs2-specific test cases to innodb-ucs2.test
      mysql-test/t/mysql.test:
        Move cp932-specific test cases to ctype_cp932.test
      mysql-test/t/mysqlbinlog.test:
        Moved cp932-specific test case to mysqlbinlog-cp932.test
      mysql-test/t/sp.test:
        Moved ucs2-specific test case to sp-ucs2.test
      sql/mysqld.cc:
        Allow specifying several character sets for test purposes, to make "mysqld" start even if the character set being tested is not compiled:
        mysqld --default-character-set=ucs2,latin1
        The first available character set will be chosen.
      mysql-test/r/innodb-ucs2.result:
        New BitKeeper file ``mysql-test/r/innodb-ucs2.result''
      mysql-test/r/mysqlbinlog-cp932.result:
        New BitKeeper file ``mysql-test/r/mysqlbinlog-cp932.result''
      mysql-test/r/sp-ucs2.result:
        New BitKeeper file ``mysql-test/r/sp-ucs2.result''
      mysql-test/t/innodb-ucs2.test:
        New BitKeeper file ``mysql-test/t/innodb-ucs2.test''
      mysql-test/t/mysqlbinlog-cp932.test:
        New BitKeeper file ``mysql-test/t/mysqlbinlog-cp932.test''
      mysql-test/t/sp-ucs2.test:
        New BitKeeper file ``mysql-test/t/sp-ucs2.test''
      db36a2aa
  12. 22 Jan, 2007 3 commits
    • unknown's avatar
      Change to new (after merge) error numbers · f7e838c5
      unknown authored
      mysql-test/extra/rpl_tests/rpl_trig004.test:
        Fixed bug in last push
      mysql-test/r/create.result:
        Fixed error number
      mysql-test/r/rpl_sp.result:
        Fixed error number
      mysql-test/r/sp.result:
        Fixed error number
      mysql-test/r/view.result:
        Better fix for now() handling
      mysql-test/t/ndb_basic.test:
        Use error names instead of numbers
      mysql-test/t/ndb_index_unique.test:
        Use error names instead of numbers
      mysql-test/t/rpl_skip_error-slave.opt:
        Change to new error number
      mysql-test/t/sp.test:
        Change to new error number
      mysql-test/t/view.test:
        Better fix for now() handling
      f7e838c5
    • unknown's avatar
      Change to new (after merge) error numbers · 560049cb
      unknown authored
      mysql-test/r/create.result:
        Fixed error number
      mysql-test/r/rpl_sp.result:
        Fixed error number
      mysql-test/r/sp.result:
        Fixed error number
      mysql-test/r/view.result:
        Better fix for now() handling
      mysql-test/t/ndb_basic.test:
        Use error names instead of numbers
      mysql-test/t/ndb_index_unique.test:
        Use error names instead of numbers
      mysql-test/t/rpl_skip_error-slave.opt:
        Change to new error number
      mysql-test/t/sp.test:
        Change to new error number
      mysql-test/t/view.test:
        Better fix for now() handling
      560049cb
    • unknown's avatar
      Give warnings for unused objects · b4f80eed
      unknown authored
      Changed error message to be compatible with old error file
      Added new error message for new DUP_ENTRY syntax
      
      
      BUILD/SETUP.sh:
        Give warnings for unused objects
      mysql-test/extra/binlog_tests/insert_select-binlog.test:
        Changed to use new error message
      mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_auto_increment.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_foreign_key.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_insert_id.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_insert_id_pk.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_loaddata.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_row_basic.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_stm_EE_err2.test:
        Changed to use new error message
      mysql-test/extra/rpl_tests/rpl_trig004.test:
        Changed to use new error message
      mysql-test/include/mix1.inc:
        Changed to use new error message
      mysql-test/include/mix2.inc:
        Changed to use new error message
      mysql-test/include/ps_modify.inc:
        Changed to use new error message
      mysql-test/include/query_cache.inc:
        Changed to use new error message
      mysql-test/include/varchar.inc:
        Changed to use new error message
      mysql-test/r/create.result:
        Changed to use new error message
      mysql-test/r/rpl_sp.result:
        Changed to use new error message
      mysql-test/r/sp.result:
        Changed to use new error message
      mysql-test/r/view.result:
        Changed to use new error message
      mysql-test/t/auto_increment.test:
        Changed to use new error message
      mysql-test/t/create.test:
        Changed to use new error message
      mysql-test/t/create_select_tmp.test:
        Changed to use new error message
      mysql-test/t/ctype_utf8.test:
        Changed to use new error message
      mysql-test/t/delayed.test:
        Changed to use new error message
      mysql-test/t/heap.test:
        Changed to use new error message
      mysql-test/t/heap_btree.test:
        Changed to use new error message
      mysql-test/t/heap_hash.test:
        Changed to use new error message
      mysql-test/t/innodb.test:
        Changed to use new error message
      mysql-test/t/insert_select.test:
        Changed to use new error message
      mysql-test/t/insert_update.test:
        Changed to use new error message
      mysql-test/t/join_outer.test:
        Changed to use new error message
      mysql-test/t/key.test:
        Changed to use new error message
      mysql-test/t/merge.test:
        Changed to use new error message
      mysql-test/t/myisam.test:
        Changed to use new error message
      mysql-test/t/ndb_charset.test:
        Changed to use new error message
      mysql-test/t/ndb_index_unique.test:
        Changed to use new error message
      mysql-test/t/ndb_insert.test:
        Changed to use new error message
      mysql-test/t/ndb_replace.test:
        Changed to use new error message
      mysql-test/t/ndb_update.test:
        Changed to use new error message
      mysql-test/t/replace.test:
        Changed to use new error message
      mysql-test/t/rpl_err_ignoredtable.test:
        Changed to use new error message
      mysql-test/t/rpl_row_create_table.test:
        Changed to use new error message
      mysql-test/t/rpl_skip_error-slave.opt:
        Changed to use new error message
      mysql-test/t/rpl_sp.test:
        Changed to use new error message
      mysql-test/t/show_check.test:
        Changed to use new error message
      mysql-test/t/sp-error.test:
        Changed to use new error message
      mysql-test/t/sp.test:
        Changed to use new error message
      mysql-test/t/sp_trans.test:
        Changed to use new error message
      mysql-test/t/temp_table.test:
        Changed to use new error message
      mysql-test/t/type_binary.test:
        Changed to use new error message
      mysql-test/t/type_bit.test:
        Changed to use new error message
      mysql-test/t/type_bit_innodb.test:
        Changed to use new error message
      mysql-test/t/type_blob.test:
        Changed to use new error message
      mysql-test/t/type_varchar.test:
        Changed to use new error message
      mysql-test/t/view.test:
        Changed to use new error message
      sql/handler.cc:
        ER_DUP_ENTRY -> ER_DUP_ENTRY_WITH_KEY_NAME
      sql/share/errmsg.txt:
        Changed error message to be compatible with old error file
        Added new error message for new DUP_ENTRY syntax
      sql/sql_table.cc:
        ER_DUP_ENTRY -> ER_DUP_ENTRY_WITH_KEY_NAME
      sql-bench/example:
        Example file for how to run tests
      b4f80eed
  13. 14 Dec, 2006 1 commit
    • unknown's avatar
      Fix for bug #24117 "server crash on a FETCH with a cursor on a table which is... · 5b712814
      unknown authored
      Fix for bug #24117 "server crash on a FETCH with a cursor on a table which is not in the table cache"
      
      Problem:
      When creating a temporary field for a temporary table in create_tmp_field_from_field(), a resulting field is created as an exact copy of an original one (in Field::new_field()). However, Field_enum and Field_set contain a pointer (typelib) to memory allocated in the parent table's MEM_ROOT, which under some circumstances may be deallocated later by the time a temporary table is used.
      
      Solution:
      Override the new_field() method for Field_enum and Field_set and create a separate copy of the typelib structure in there.
      
      
      include/typelib.h:
        Added copy_typelib() declaration
      mysql-test/r/sp.result:
        Added a testcase for bug #24117 "server crash on a FETCH with a cursor on a table which is not in the table cache"
      mysql-test/t/sp.test:
        Added a testcase for bug #24117 "server crash on a FETCH with a cursor on a table which is not in the table cache"
      mysys/typelib.c:
        Added copy_typelib() definition
      sql/field.cc:
        Create a copy of the internal 'typelib' structure when copying Field_enum of Field_set objects.
      sql/field.h:
        Override new_field method in Field_enum (and Field_set) to copy the typelib structure.
      5b712814
  14. 11 Dec, 2006 1 commit
    • unknown's avatar
      Post-merge fixes for Bug#4968 "Stored procedure crash if cursor opened · a8103a89
      unknown authored
      on altered table" and Bug#19733 "Repeated alter, or repeated 
      create/drop, fails"
      
      
      mysql-test/r/ps.result:
        Post-merge fixes: update results with new tests.
      mysql-test/r/sp.result:
        Post-merge fixes: update results.
      mysql-test/t/ps.test:
        Add more test cases for Bug#4968 and related.
      mysql-test/t/sp.test:
        A post-merge fix: add more testcases for Bug#4968 and related.
      sql/sql_insert.cc:
        Post-merge fixes: update comments, fix errors of the manual merge.
      sql/sql_lex.cc:
        Fix a manual merge error.
      sql/sql_parse.cc:
        Fix a few errors of the manual merge, style.
      sql/sql_table.cc:
        Post-merge fixes, fix a few errors of the manual merge, fix style.
      sql/sql_yacc.yy:
        A post-merge fix.
      a8103a89
  15. 17 Nov, 2006 1 commit
    • unknown's avatar
      Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR · b84e9d10
      unknown authored
      Fix tests for new behaviour: an error is thrown if a NON DETERMINISTIC
      stored function (SF) is called during statement-based replication (SBR).
      
      
      mysql-test/r/func_time.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/r/gis.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Mark function as DETERMINISTIC so it can be called with no error while
        doing statement-based replication (SBR).
      mysql-test/r/grant2.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/r/innodb_notembedded.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/r/ps.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Mark function as DETERMINISTIC so it can be called with no error while
        doing statement-based replication (SBR).
      mysql-test/r/query_cache.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/r/query_cache_notembedded.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/r/rpl_sp.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Move test for SF-calls in different replication modes to its own file, rpl_sf.
      mysql-test/r/rpl_sp_effects.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/r/sp.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Mark function as DETERMINISTIC so it can be called with no error while
        doing statement-based replication (SBR).
      mysql-test/r/timezone2.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/func_time.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/gis.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Mark function as DETERMINISTIC so it can be called with no error while
        doing statement-based replication (SBR).
      mysql-test/t/grant2.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/innodb_notembedded.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/ps.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/query_cache.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/query_cache_notembedded.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/rpl_sp.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/rpl_sp_effects.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      mysql-test/t/sp.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Mark function as DETERMINISTIC so it can be called with no error while
        doing statement-based replication (SBR).
      mysql-test/t/timezone2.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Modify test that contains non-deterministic functions so it can still be
        called with no error while doing statement-based replication (SBR).
      sql/item_func.cc:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        If 'log_bin_trust_function_creators' variable is set, don't throw an error
        on calling a non-deterministc function in statement-based replication (SBR).
      sql/sql_parse.cc:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Do not throw an error on calling a NON DETERMINISTIC stored procedure (SP)
        while doing statement-based replication (SBR), as the routine body is
        executed statement-by-statement.
      mysql-test/r/rpl_sf.result:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Test for stored function (SF) calls in different replication modes.
        NON DETERMINISTIC SFs are not allowed while doing
        statement-based replication (SBR).
      mysql-test/t/rpl_sf.test:
        Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
        
        Test for stored function (SF) calls in different replication modes.
        NON DETERMINISTIC SFs are not allowed while doing
        statement-based replication (SBR).
      b84e9d10
  16. 15 Nov, 2006 2 commits
    • unknown's avatar
    • unknown's avatar
      Bug#18239 (Possible to overload internal functions with stored functions) · 418fd548
      unknown authored
      Bug#21025 (misleading error message when creating functions named 'x', or 'y')
      Bug#22619 (Spaces considered harmful)
      
      This change contains a fix to report warnings or errors, and multiple tests
      cases.
      
      Before this fix, name collisions between:
      - Native functions
      - User Defined Functions
      - Stored Functions
      were not systematically reported, leading to confusing behavior.
      
      I) Native / User Defined Function
      
      Before this fix, is was possible to create a UDF named "foo", with the same
      name as a native function "foo", but it was impossible to invoke the UDF,
      since the syntax "foo()" always refer to the native function.
      After this fix, creating a UDF fails with an error if there is a name
      collision with a native function.
      
      II) Native / Stored Function
      
      Before this fix, is was possible to create a SF named "db.foo", with the same
      name as a native function "foo", but this was confusing since the syntax
      "foo()" would refer to the native function. To refer to the Stored Function,
      the user had to use the "db.foo()" syntax.
      After this fix, creating a Stored Function reports a warning if there is a
      name collision with a native function.
      
      III) User Defined Function / Stored Function
      
      Before this fix, creating a User Defined Function "foo" and a Stored Function
      "db.foo" are mutually exclusive operations. Whenever the second function is
      created, an error is reported. However, the test suite did not cover this
      behavior.
      After this fix, the  behavior is unchanged, and is now covered by test cases.
      
      Note that the code change in this patch depends on the fix for Bug 21114.
      
      
      mysql-test/r/sp.result:
        New test cases.
      mysql-test/r/udf.result:
        New test cases.
      mysql-test/t/sp.test:
        New test cases.
      mysql-test/t/udf.test:
        New test cases.
      sql/sql_lex.cc:
        Name collisions with native functions.
      sql/sql_lex.h:
        Name collisions with native functions.
      sql/sql_yacc.yy:
        Name collisions with native functions.
      sql/share/errmsg.txt:
        Name collisions with native functions.
      mysql-test/r/sp_gis.result:
        New test cases.
      mysql-test/t/sp_gis.test:
        New test cases.
      418fd548
  17. 14 Nov, 2006 1 commit
    • unknown's avatar
      Fix for bug#23760 ROW_COUNT() and store procedure not owrking together · 645aac54
      unknown authored
      The problem was that THD::row_count_func was zeroed too. It was zeroed
      as a fix for bug 4905 "Stored procedure doesn't clear for "Rows affected"
      However, the proper solution is not to zero, because THD::row_count_func has
      been set to -1 already in mysql_execute_command(), a later fix, which obsoletes
      the incorrect fix of #4095
      
      
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        test for bug#23760 ROW_COUNT() and store procedure not owrking together
      sql/sql_parse.cc:
        Remove zeroing for thd->row_count_func
        The fix for #4905 wasn't right. Now, it's ok without this zeroing
        because if there was an error THD::
      645aac54
  18. 19 Oct, 2006 1 commit
    • unknown's avatar
      Bug#20028 (Function with select return no data) · 5bd58f3e
      unknown authored
      This patch reverts a change introduced by Bug 6951, which incorrectly
      set thd->abort_on_warning for stored procedures.
      
      As per internal discussions about the SQL_MODE=TRADITIONAL,
      the correct behavior is to *not* abort on warnings even inside an INSERT/UPDATE
      trigger.
      
      Tests for Stored Procedures, Stored Functions, Triggers involving SQL_MODE
      have been included or revised, to reflect the intended behavior.
      
      (reposting approved patch, to work around source control issues, no review needed)
      
      
      mysql-test/include/sp-vars.inc:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/r/sp-vars.result:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/r/sp.result:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/r/trigger.result:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/t/sp-vars.test:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/t/sp.test:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/t/trigger.test:
        Tests for SQL_MODE='TRADITIONAL'
      sql/sp_head.cc:
        For SQL_MODE='TRADITIONAL',
        thd->abort_on_warning should be set only when assigning a *column*
      5bd58f3e
  19. 17 Oct, 2006 1 commit
    • unknown's avatar
      Bug#20028 (Function with select return no data) · 81569524
      unknown authored
      This patch reverts a change introduced by Bug 6951, which incorrectly
      set thd->abort_on_warning for stored procedures.
      
      As per internal discussions about the SQL_MODE=TRADITIONAL,
      the correct behavior is to *not* abort on warnings even inside an INSERT/UPDATE
      trigger.
      
      Tests for Stored Procedures, Stored Functions, Triggers involving SQL_MODE
      have been included or revised, to reflect the intended behavior.
      
      
      mysql-test/include/sp-vars.inc:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/r/sp-vars.result:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/r/sp.result:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/r/trigger.result:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/t/sp-vars.test:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/t/sp.test:
        Tests for SQL_MODE='TRADITIONAL'
      mysql-test/t/trigger.test:
        Tests for SQL_MODE='TRADITIONAL'. Revised the expected behavior for triggers
      sql/sp_head.cc:
        For SQL_MODE='TRADITIONAL',
        thd->abort_on_warning should be set only when assigning a *column*
      81569524
  20. 09 Oct, 2006 1 commit
    • unknown's avatar
      Bug#21462 (Stored procedures with no arguments require parenthesis) · e1e0f829
      unknown authored
      The syntax of the CALL statement, to invoke a stored procedure, has been
      changed to make the use of parenthesis optional in the argument list.
      With this change, "CALL p;" is equivalent to "CALL p();".
      
      While the SQL spec does not explicitely mandate this syntax, supporting it
      is needed for practical reasons, for integration with JDBC / ODBC connectors.
      
      Also, warnings in the sql/sql_yacc.yy file, which were not reported by Bison 2.1
      but are now reported by Bison 2.2, have been fixed.
      
      The warning found were:
      bison -y -p MYSQL  -d --debug --verbose sql_yacc.yy
      sql_yacc.yy:653.9-18: warning: symbol UNLOCK_SYM redeclared
      sql_yacc.yy:656.9-17: warning: symbol UNTIL_SYM redeclared
      sql_yacc.yy:658.9-18: warning: symbol UPDATE_SYM redeclared
      sql_yacc.yy:5169.11-5174.11: warning: unused value: $2
      sql_yacc.yy:5208.11-5220.11: warning: unused value: $5
      sql_yacc.yy:5221.11-5234.11: warning: unused value: $5
      conflicts: 249 shift/reduce
      
      "unused value: $2" correspond to the $$=$1 assignment in the 1st {} block
      in table_ref -> join_table {} {},
      which does not procude a result ($$) for the rule but an intermediate $2
      value for the action instead.
      "unused value: $5" are similar, with $$ assignments in {} actions blocks
      which are not for the final reduce.
      
      
      mysql-test/r/sp.result:
        New test case for Bug#21462
      mysql-test/t/sp.test:
        New test case for Bug#21462
      sql/sql_yacc.yy:
        "CALL p;" syntax for calling a stored procedure
        Fixed bison 2.2 warnings.
      e1e0f829
  21. 04 Oct, 2006 1 commit
    • unknown's avatar
      Update tests and result files after running with new mysqltest that better... · 9cf998e6
      unknown authored
      Update tests and result files after running with new mysqltest that better detects problems with test files
      
      
      mysql-test/r/csv.result:
        Update after add of missing semicolon
      mysql-test/r/drop.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/flush.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/flush_block_commit.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/flush_read_lock_kill.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/grant2.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/handler.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/innodb_notembedded.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/kill.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/lock_multi.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/multi_update.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/mysqltest.result:
        Update result
      mysql-test/r/query_cache.result:
        Update after add of missing semicolon
      mysql-test/r/query_cache_notembedded.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/sp-threads.result:
        Update result file, no space before commands that has been "sent"
      mysql-test/r/sp_notembedded.result:
        Update after add of missing semicolon
      mysql-test/r/type_blob.result:
        Remove extra drop table
      mysql-test/t/csv.test:
        Add missing semicolon
      mysql-test/t/query_cache.test:
        Add missing semicolon
      mysql-test/t/sp-error.test:
        Remove "tab" from end of error declaration
      mysql-test/t/sp.test:
        Wrong delimiter, used ; instead of |
      mysql-test/t/sp_notembedded.test:
        Wrong delimiter, used ; instead of |
      mysql-test/t/view_grant.test:
        An incomplete error name specification was used.
      9cf998e6
  22. 29 Sep, 2006 2 commits
  23. 28 Sep, 2006 1 commit
    • unknown's avatar
      Bug#22436 Four tests require "innodb" to be configured, fail in "classic" build · d8d57c77
      unknown authored
       - Disable warnings when creating the "innodb" tables if it works anyway.
       - Move test that are really innodb dependent to innodb_mysql 
      
      
      mysql-test/r/create.result:
        Move the innodb dependent test to innodb_mysql.test
      mysql-test/r/innodb_mysql.result:
        Move the innodb dependent test to innodb_mysql.test
      mysql-test/t/create.test:
        Move the innodb dependent test to innodb_mysql.test
      mysql-test/t/innodb_mysql.test:
        Move the innodb dependent test to innodb_mysql.test
      mysql-test/t/lock_multi.test:
        Disable warnings while creating the innodb table. If innodb is not available, the table will be created with default engine and thus create a warning. Regardless of this, test output should be the same.
      mysql-test/t/sp.test:
        Disable warnings while creating the innodb table. If innodb is not available, the table will be created with default engine and thus create a warning. Regardless of this, test output should be the same.
      mysql-test/t/view.test:
        Disable warnings while creating the innodb table. If innodb is not available, the table will be created with default engine and thus create a warning. Regardless of this, test output should be the same.
      d8d57c77
  24. 27 Sep, 2006 1 commit
    • unknown's avatar
      Fix for bug#21311: Possible stack overrun if SP has non-latin1 name · fcb8687a
      unknown authored
        
      There was possible stack overrun in an edge case which handles invalid body of
      a SP in mysql.proc . That should be case when mysql.proc has been changed
      manually. Though, due to bug 21513, it can be exploited without having access
      to mysql.proc only being able to create a stored routine.
      
      
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        add a test case for the bug
      sql/sp.cc:
        Fix stack overrun. This happen mostly when mysql.proc is damaged, though
        it's possible due to another bug which creates invalid SP body in mysql.proc
        (leading quote from a label being cut) to create stack overrun even without
        having direct access to mysql.proc
      fcb8687a
  25. 16 Sep, 2006 1 commit
    • unknown's avatar
      Fixed bug #21493: crash for the second execution of a function · 58e178c5
      unknown authored
      containing a select statement that uses an aggregating IN subquery.
      Added a parameter to the function fix_prepare_information 
      to restore correctly the having clause for the second execution.
      Saved andor structure of the having conditions at the proper moment
      before any calls of split_sum_func2 that could modify the having structure
      adding new Item_ref objects. (These additions, are produced not with 
      the statement mem_root, but rather with the execution mem_root.)
      
      
      mysql-test/r/sp.result:
        Added a test case for bug #21493.
      mysql-test/t/sp.test:
        Added a test case for bug #21493.
      sql/sql_delete.cc:
        Fixed bug #21493: crash for the second execution of a function
        containing a select statement that uses an aggregating IN subquery.
        Added a parameter to the function fix_prepare_information 
        to restore correctly the having clause for the second execution.
      sql/sql_insert.cc:
        Fixed bug #21493: crash for the second execution of a function
        containing a select statement that uses an aggregating IN subquery.
        Added a parameter to the function fix_prepare_information 
        to restore correctly the having clause for the second execution.
      sql/sql_lex.cc:
        Fixed bug #21493: crash for the second execution of a function
        containing a select statement that uses an aggregating IN subquery.
        Added a parameter to the function fix_prepare_information 
        to restore correctly the having clause for the second execution.
      sql/sql_lex.h:
        Fixed bug #21493: crash for the second execution of a function
        containing a select statement that uses an aggregating IN subquery.
        Added a parameter to the function fix_prepare_information 
        to restore correctly the having clause for the second execution.
      sql/sql_update.cc:
        Fixed bug #21493: crash for the second execution of a function
        containing a select statement that uses an aggregating IN subquery.
        Added a parameter to the function fix_prepare_information 
        to restore correctly the having clause for the second execution.
      58e178c5
  26. 12 Sep, 2006 1 commit
    • unknown's avatar
      BUG#21414: SP: Procedure undroppable, to some extent · d4933af8
      unknown authored
      The problem was that if after FLUSH TABLES WITH READ LOCK the user
      issued DROP/ALTER PROCEDURE/FUNCTION the operation would fail (as
      expected), but after UNLOCK TABLE any attempt to execute the same
      operation would lead to the error 1305 "PROCEDURE/FUNCTION does not
      exist", and an attempt to execute any stored function will also fail.
      
      This happened because under FLUSH TABLES WITH READ LOCK we couldn't open
      and lock mysql.proc table for update, and this fact was erroneously
      remembered by setting mysql_proc_table_exists to false, so subsequent
      statements believed that mysql.proc doesn't exist, and thus that there
      are no functions and procedures in the database.
      
      As a solution, we remove mysql_proc_table_exists flag completely.  The
      reason is that this optimization didn't work most of the time anyway.
      Even if open of mysql.proc failed for some reason when we were trying to
      call a function or a procedure, we were setting mysql_proc_table_exists
      back to true to force table reopen for the sake of producing the same
      error message (the open can fail for number of reasons).  The solution
      could have been to remember the reason why open failed, but that's a lot
      of code for optimization of a rare case.  Hence we simply remove this
      optimization.
      
      
      mysql-test/r/sp.result:
        Add result for bug#21414: SP: Procedure undroppable, to some extent.
      mysql-test/t/sp.test:
        Remove no longer relevant comment.
        Add test case for bug#21414: SP: Procedure undroppable, to some extent.
      sql/mysql_priv.h:
        Remove declaration of mysql_proc_table_exists.
      sql/sp.cc:
        Remove references to mysql_proc_table_exists.
      sql/sql_acl.cc:
        Remove reference to mysql_proc_table_exists.
      d4933af8
  27. 07 Sep, 2006 1 commit
    • unknown's avatar
      BUG#20492: Subsequent calls to stored procedure yield incorrect result · ee09b41e
      unknown authored
                 if join is used
      
      For procedures with selects that use complicated joins with ON expression
      re-execution could erroneously ignore this ON expression, giving
      incorrect result.
      
      The problem was that optimized ON expression wasn't saved for
      re-execution.  The solution is to properly save it.
      
      
      mysql-test/r/sp.result:
        Add result for bug#20492: Subsequent calls to stored procedure yield
        incorrect result if join is used.
      mysql-test/t/sp.test:
        Add test case for bug#20492: Subsequent calls to stored procedure yield
        incorrect result if join is used.
      sql/sql_select.cc:
        Save modified ON expression for re-execution.
      ee09b41e
  28. 24 Aug, 2006 2 commits
    • unknown's avatar
      Fix for bug#21416 SP: Recursion level higher than zero needed for non-recursive call · 807ecdf4
      unknown authored
      The following procedure was not possible if max_sp_recursion_depth is 0
      create procedure show_proc() show create procedure show_proc;
        
      Actually there is no recursive call but the limit is checked.
        
      Solved by temporarily increasing the thread's limit just before the fetch from cache
      and decreasing after that.
      
      
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        Test for bug #21416 SP: Recursion level higher than zero needed for non-recursive call
      sql/sp.cc:
        Increase the max_sp_recursion_depth temporarily for SHOW CREATE PROCEDURE call.
        This call is in fact not recursive but is counted as such. Outcome, it will work
        always but if max_sp_recursion_depth is reached we are going to cache one more
        sp_head instance.
      807ecdf4
    • unknown's avatar
      Fix for BUG#16899: Possible buffer overflow in handling of DEFINER-clause · 21e6836b
      unknown authored
          
      User name (host name) has limit on length. The server code relies on these
      limits when storing the names. The problem was that sometimes these limits
      were not checked properly, so that could lead to buffer overflow.
        
      The fix is to check length of user/host name in parser and if string is too
      long, throw an error.
      
      
      mysql-test/r/grant.result:
        Updated result file.
      mysql-test/r/sp.result:
        Updated result file.
      mysql-test/r/trigger.result:
        Updated result file.
      mysql-test/r/view.result:
        Updated result file.
      mysql-test/t/grant.test:
        Added test for BUG#16899.
      mysql-test/t/sp.test:
        Added test for BUG#16899.
      mysql-test/t/trigger.test:
        Added test for BUG#16899.
      mysql-test/t/view.test:
        Added test for BUG#16899.
      sql/mysql_priv.h:
        Added prototype for new function.
      sql/sql_acl.cc:
        Remove outdated checks.
      sql/sql_parse.cc:
        Add a new function for checking string length.
      sql/share/errmsg.txt:
        Added new resources.
      sql/sql_yacc.yy:
        Check length of user/host name.
      21e6836b
  29. 23 Aug, 2006 2 commits
    • unknown's avatar
      Fix for BUG#16899: Possible buffer overflow in handling of DEFINER-clause · f96ee72f
      unknown authored
        
      User name (host name) has limit on length. The server code relies on these
      limits when storing the names. The problem was that sometimes these limits
      were not checked properly, so that could lead to buffer overflow.
      
      The fix is to check length of user/host name in parser and if string is too
      long, throw an error.
      
      
      mysql-test/r/grant.result:
        Updated result file.
      mysql-test/r/sp.result:
        Updated result file.
      mysql-test/r/trigger.result:
        Updated result file.
      mysql-test/r/view.result:
        Updated result file.
      mysql-test/t/grant.test:
        Added test for BUG#16899.
      mysql-test/t/sp.test:
        Added test for BUG#16899.
      mysql-test/t/trigger.test:
        Added test for BUG#16899.
      mysql-test/t/view.test:
        Added test for BUG#16899.
      sql/mysql_priv.h:
        Added prototype for new function.
      sql/share/errmsg.txt:
        Added new resources.
      sql/sql_acl.cc:
        Remove outdated checks.
      sql/sql_parse.cc:
        Add a new function for checking string length.
      sql/sql_yacc.yy:
        Check length of user/host name.
      f96ee72f
    • unknown's avatar
      Bug#8153 (Stored procedure with subquery and continue handler, wrong result) · 09e9b2f6
      unknown authored
      Implemented code review comments
      Test cleanup
      
      
      sql/protocol.cc:
        Bug#8153 (Stored procedure with subquery and continue handler, wrong result)
        
        Implemented code review comments
      09e9b2f6
  30. 09 Aug, 2006 1 commit
    • unknown's avatar
      Fix for bug#20701 BINARY keyword should be forbidden in stored routines · 0231ca09
      unknown authored
          
      create function func() returns char(10) binary ...
      is no more possible. This will be reenabled when 
      bug 2676 "DECLARE can't have COLLATE clause in stored procedure"
      is fixed.
      
      Fix after 2nd review
      
      
      mysql-test/r/sp-error.result:
        update result
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp-error.test:
        add a test case for bug#20701 BINARY keyword should be forbidden in stored procedures
      mysql-test/t/sp.test:
        Fix test case which uses binary for the return value of a function.
        It's no more possible after fix for bug#20701 
        BINARY keyword should be forbidden in SP
        
        Fix few glitches where ; is used instead of | . The delimiter is |
      sql/sql_yacc.yy:
        Fix for bug#20701 BINARY keyword should be forbidden in stored routines
        
        create function func() returns char(10) binary ...
        is no more possible. This will be reenabled when 
        bug 2676 "DECLARE can't have COLLATE clause in stored procedure"
        is fixed
      0231ca09
  31. 04 Aug, 2006 1 commit
    • unknown's avatar
      Fix for bug#21416 SP: Recursion level higher than zero needed for non-recursive call · e60678ae
      unknown authored
      The following procedure was not possible if max_sp_recursion_depth is 0
      create procedure show_proc() show create procedure show_proc;
      
      Actually there is no recursive call but the limit is checked.
      
      Solved by temporarily increasing the thread's limit just before the fetch from cache
      and decreasing after that.
      
      
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        Test for bug #21416 SP: Recursion level higher than zero needed for non-recursive call
      sql/sp.cc:
        Increase the max_sp_recursion_depth temporarily for SHOW CREATE PROCEDURE call.
        This call is in fact not recursive but is counted as such. Outcome, it will work
        always but if max_sp_recursion_depth is reached we are going to cache one more
        sp_head instance.
      e60678ae