An error occurred fetching the project authors.
  1. 20 Oct, 2005 1 commit
    • unknown's avatar
      Bug#12371: executing prepared statement fails (illegal mix of collations) · 06164d5d
      unknown authored
      ctype_utf8.test, ctype_utf8.result:
        Adding test case.
      item.h:
      item.cc:
        Adding Item_param::safe_charset_converter
      
      
      sql/item.cc:
         Bug#12371: executing prepared statement fails (illegal mix of collations)
        Adding Item_param::safe_charset_converter
      sql/item.h:
        Adding Item_param::safe_charset_converter
      mysql-test/r/ctype_utf8.result:
        Adding test case.
      mysql-test/t/ctype_utf8.test:
        Adding test case.
      06164d5d
  2. 13 Oct, 2005 2 commits
    • unknown's avatar
      Fixes during review of new pushed code · 79538fb6
      unknown authored
      sql/handler.cc:
        Indentation fixes
      sql/item.cc:
        Remove not needed test of *ref (If ref is set it always points to a valid address)
      sql/table.cc:
        Indentation changes
        Moved buff_end directly after 'buff' assignment to make code more clear
      sql/unireg.cc:
        Indentation changes
      79538fb6
    • unknown's avatar
      Review of new pushed code · d853ecd6
      unknown authored
      - No need to check *ref when ref is checked (Simple optimization fix)
      
      
      sql/item.cc:
        No need to check *ref
      d853ecd6
  3. 12 Oct, 2005 1 commit
    • unknown's avatar
      select.test, sql_select.cc, sql_lex.cc, item.cc: · a46e8e23
      unknown authored
        Bug #7672 after merge fix
      
      
      sql/item.cc:
        Bug #7672 after merge fix
      sql/sql_lex.cc:
        Bug #7672 after merge fix
      sql/sql_select.cc:
        Bug #7672 after merge fix
      mysql-test/t/select.test:
        Bug #7672 after merge fix
      a46e8e23
  4. 09 Oct, 2005 1 commit
    • unknown's avatar
      Fix bug#7672 Unknown column error in order clause · f3f84ed8
      unknown authored
      When fixing Item_func_plus in ORDER BY clause field c is searched in all
      opened tables, but because c is an alias it wasn't found there.
      
      This patch adds a flag to select_lex which allows Item_field::fix_fields() 
      to look up in select's item_list to find aliased fields.
      
      
      sql/item.cc:
        Fix bug#7672 Unknown column error in order clause
        When fixing fields in ORDER BY clause allow Item_field::fix_fields() to look up items in select's item list to find aliased fields.
      sql/sql_lex.cc:
         Fix bug#7672 Unknown column error in order clause
      sql/sql_lex.h:
        Fix bug#7672 Unknown column error in order clause
        Added flag to select_lex allowing Item_field::fix_fields to look up items in select's item list.
      sql/sql_select.cc:
        Fix bug#7672 Unknown column error in order clause
      mysql-test/t/select.test:
        Test case for bug#7672 Unknown column error in order clause
      mysql-test/r/select.result:
        Test case for bug#7672 Unknown column error in order clause
      f3f84ed8
  5. 07 Oct, 2005 1 commit
    • unknown's avatar
      Review of new code since last pull · 3dcf2056
      unknown authored
      - Use %lx instead of %p as %p is not portable
      - Don't replace ROW item with Item_null
      
      
      myisam/mi_rkey.c:
        Use %lx instead of %p as %p is not portable
      myisam/mi_search.c:
        Use %lx instead of %p as %p is not portable
      mysql-test/r/select.result:
        More test for ROW comparison
      mysql-test/t/select.test:
        More test for ROW comparison
      sql/item.cc:
        We can't replace a ROW item with Item_null because:
        - Arg_comparator is still using the orignal row items and it's not good to have args[0] different from what is actually compared
        - If we are using the <=> comparator, NULL can still be compared as true
        - We would break things if we would ever use resolve_const_item() for operators like >, < etc.
      3dcf2056
  6. 06 Oct, 2005 1 commit
    • unknown's avatar
      Review of code pushed since last 5.0 pull: · c807724f
      unknown authored
      Ensure that ccache is also used for C programs
      mysql: Ensure that 'delimiter' works the same way in batch mode as in normal mode
      mysqldump: Change to use ;; (instead of //) as a stored procedure/trigger delimiter
      Fixed test cases by adding missing DROP's and rename views to be of type 'v#'
      Removed MY_UNIX_PATH from fn_format()
      Removed current_db_used from TABLE_LIST
      Removed usage of 'current_thd' in Item_splocal
      Removed some compiler warnings
      A bit faster longlong2str code
      
      
      
      BUILD/FINISH.sh:
        Ensure that ccache is also used for C programs
      BUILD/SETUP.sh:
        Ensure that ccache is also used for C programs
      client/mysql.cc:
        More debugging
        Ensure that 'delimiter' works the same way in batch mode as in normal mode.
        Compare 'delimiter' command case-insensitive.
        The above fixes the delimiter bugs so that we can now use ;; as a trigger/SP function delimiter in mysqldump.
      client/mysqldump.c:
        Indentation fixes
        Use ;; as a delmimiter for stored procedures and triggers instead of //
      client/mysqltest.c:
        Indentation fixes
      include/my_sys.h:
        Remove not needed MY_UNIX_PATH parameter
      mysql-test/r/alter_table.result:
        Better to reuse mysqltest database (test didn't properly delete mysqltest1 at start)
      mysql-test/r/func_str.result:
        More testing of CONV() (to ensure that longlong2str() works correctly)
      mysql-test/r/information_schema.result:
        Drop all used tables and views
        Rename view tables to 'v#' to ensure that if this test fails, not a lot of other test fails
      mysql-test/r/information_schema_inno.result:
        Drop all used tables
      mysql-test/r/multi_statement.result:
        Drop used tables
      mysql-test/r/mysql.result:
        Add error messages to result
      mysql-test/r/mysqldump.result:
        ;; is now used as SP/trigger delimiter
      mysql-test/r/mysqlshow.result:
        Drop used tables
      mysql-test/r/temp_table.result:
        Drop used views
        Rename views to v#
      mysql-test/t/alter_table.test:
        Better to reuse mysqltest database (test didn't properly delete mysqltest1 at start)
      mysql-test/t/func_str.test:
        More testing of CONV() (to ensure that longlong2str() works correctly)
      mysql-test/t/information_schema.test:
        Drop all used tables and views
        Rename view tables to 'v#' to ensure that if this test fails, not a lot of other test fails
      mysql-test/t/information_schema_inno.test:
        Drop all used tables
      mysql-test/t/multi_statement.test:
        Drop used tables
      mysql-test/t/mysql.test:
        Add error messages to result
      mysql-test/t/mysqlshow.test:
        Drop used tables
      mysql-test/t/temp_table.test:
        Drop used views
        Rename views to v#
      mysys/mf_format.c:
        Remove not needed MY_UNIX_PATH parameter
        (This goes against how fn_format() is supposed to work and also conflicts with other options like MY_RETURN_REAL_PATH)
      sql/ha_federated.cc:
        Removed extra empty line
      sql/item.cc:
        Use 'str_value' instead of 'str_value_ptr' to hold result for Item_splocal
        Remove some calls to 'thd' in Item_splocal by making 'thd' a class variable
        One doesn't have to set 'null_value' when calling 'is_null()'
      sql/item.h:
        Add THD as a class variable to Item_splocal
        Use 'str_value' instead of 'str_value_ptr' to hold temp result
        Fixed bug in Item_hex when used in CAST()
      sql/item_func.cc:
        Optimize new code
      sql/log_event.cc:
        Move 'to_unix_path()' out of fn_format()
      sql/opt_range.cc:
        Simplify code
      sql/sp_head.cc:
        Ensure that Item_splocal has thd set before we call '->this_item()'
      sql/sql_class.cc:
        Return error if Statement::insert() fails in either hash_insert()
      sql/sql_parse.cc:
        Remove 'current_db_used' as we can trivially check if db table qualifier was used without this.
        Simplify code
      sql/sql_prepare.cc:
        Use enum instead of const int, to avoid ugly code for VC++
      sql/structs.h:
        Remove compiler warnings when using STRING_WITH_LEN() with constant strings.
      sql/table.cc:
        Fixed indentation
      sql/table.h:
        Remove not needed current_db_used
      strings/decimal.c:
        Simplify code
      strings/longlong2str-x86.s:
        A bit faster longlong2str.
        (Took some ideas from Peter Gulutzan's code)
      strings/my_strtoll10.c:
        Simplify code for MetroWerks compiler
      c807724f
  7. 01 Oct, 2005 1 commit
    • unknown's avatar
      Fix for BUG#13410 - qualified reference to a view column in the HAVING clause cannot be resolved. · 58263844
      unknown authored
      The problem was then when a column reference was resolved to a view column, the new Item
      created for this column contained the name of the view, and not the view alias.
      
      
      mysql-test/r/view.result:
        Additional test for BUG#13410.
      mysql-test/t/view.test:
        Additional test for BUG#13410.
      sql/item.cc:
        Correctly cast 'cur_field' to Item_ident because if the original item is
        an Item_field, the cur_field is either an Item_field or an Item_ref.
        Thus we have to cast cur_field to a common super-class of both.
      sql/item.h:
        - real_item() may be called before Item_ref::ref is set
          (i.e. the Item_ref object was resolved).
        - To avoid a crash and to return some meaningful value
          in such cases we return 'this'.
      sql/sql_base.cc:
        - 'item' may be an Item_ref, so we test for the type of the actual
          referenced item.
        - Correctly cast 'cur_field' to Item_ident because if the original
          item is an Item_field, the cur_field is either an Item_field or an
          Item_ref. Thus we have to cast cur_field to a common super-class
          of both.
      sql/table.cc:
        - When creating a new Item for a reference to a view column, use the view alias,
          and not the real view name.
        - Removed old code
      58263844
  8. 28 Sep, 2005 1 commit
    • unknown's avatar
      select.result, item.cc: · 0fda286a
      unknown authored
        After merge fix for bug#13356
      
      
      sql/item.cc:
        After merge fix for bug#13356
      mysql-test/r/select.result:
        After merge fix for bug#13356
      0fda286a
  9. 27 Sep, 2005 6 commits
    • unknown's avatar
      Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items. · a17b3dcb
      unknown authored
      resolve_const_item() assumed to be not called for Item_row items. For
      ensuring that DBUG_ASSERT(0) was set there.
      
      This patch adds section for Item_row items. If it can it recursively calls
      resolve_const_item() for each item the Item_row contains. If any of the
      contained items is null then whole Item_row substitued by Item_null. Otherwise
      it just returns.
      
      
      sql/item.cc:
        Fix bug#13356 resolve_const_item() wasn't able to handle Item_row items.
        
        Added section to resolve_const_item() for Item_row items. If it can it
        recursively calls resolve_const_item() for each item the Item_row contains. If
        any of the contained items is null then Item_row is substituted by Item_null.
        Otherwise it just returns.
        Comment moved closer to function it belongs to.
      mysql-test/t/select.test:
        Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items.
      mysql-test/r/select.result:
        Test case for bug#13356 resolve_const_item() wasn't able to handle Item_row items.
      a17b3dcb
    • unknown's avatar
      Fixed BUG#12589: Assert when creating temp. table from decimal stored · 06eabeee
      unknown authored
                       procedure variable
        Second version, after review.
        Keep the unsigned_flag in Item_decimal updated. Note that this also changed
        the result of several old test results - creating tables from decimal
        templates now gives unsigned columns and different sizes. (Several tests
        had Length > Max_length before.)
      
      
      mysql-test/r/case.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/metadata.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/ps_2myisam.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/ps_3innodb.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/ps_4heap.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/ps_5merge.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/ps_6bdb.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/ps_7ndb.result:
        Updated result (after fixing BUG#12589).
      mysql-test/r/sp.result:
        New test case for BUG#12589.
      mysql-test/r/type_newdecimal.result:
        Updated result (after fixing BUG#12589).
      mysql-test/t/sp.test:
        New test case for BUG#12589.
      sql/item.cc:
        Keep the unsigned_flag updated in Item_splocal and Item_decimal.
      06eabeee
    • unknown's avatar
      additional fix to the bug #13372 (decimal union) · 57e700d7
      unknown authored
      mysql-test/r/type_float.result:
        test result fixed
      sql/item.cc:
        we have to limit the max_length
      57e700d7
    • unknown's avatar
      Fix for bug #13372 (decimal union) · 087f7cc8
      unknown authored
      mysql-test/r/type_decimal.result:
        test result fixed
      mysql-test/r/type_float.result:
        test result fixed
      mysql-test/t/type_decimal.test:
        test case added
      mysql-test/t/type_float.test:
        test case added
      sql/item.cc:
        Fixed counting of the max_length for the REAL_RESULT
      087f7cc8
    • unknown's avatar
      item.cc: · d7e4e1a5
      unknown authored
        Fixed bug #13410.
        Fixed name resolution for qualified reference to a view column
        in the HAVING clause.
      view.result, view.test:
        Added a test case for bug #13410.
      
      
      mysql-test/t/view.test:
        Added a test case for bug #13410.
      mysql-test/r/view.result:
        Added a test case for bug #13410.
      sql/item.cc:
        Fixed bug #13410.
        Fixed name resolution for qualified reference to a view column
        in the HAVING clause.
      d7e4e1a5
    • unknown's avatar
      sql_base.cc, item.cc: · f6a552b1
      unknown authored
        Fixed bug #13411.
        Fixed name resolution for non-qualified reference to a view column
        in the HAVING clause.
      view.result, view.test:
        Added a test case for bug #13411.
      
      
      mysql-test/t/view.test:
        Added a test case for bug #13411.
      mysql-test/r/view.result:
        Added a test case for bug #13411.
      sql/item.cc:
        Fixed bug #13411.
        Fixed name resolution for non-qualified reference to a view column
        in the HAVING clause.
      sql/sql_base.cc:
        Fixed bug #13411.
        Fixed name resolution for non-qualified reference to a view column
        in the HAVING clause.
      f6a552b1
  10. 15 Sep, 2005 1 commit
    • unknown's avatar
      WL#2787 (part 2, ver 3 (merged)) changed securety context switching · 84f029a4
      unknown authored
      libmysqld/lib_sql.cc:
        changed securety context switching
      mysql-test/r/rpl_sp.result:
        now it show real information from changed security context of SP (checked)
      sql/ha_innodb.cc:
        changed securety context switching
      sql/item.cc:
        changed securety context switching
      sql/item_func.cc:
        changed securety context switching
      sql/item_strfunc.cc:
        changed securety context switching
      sql/log.cc:
        changed securety context switching
      sql/mysql_priv.h:
        changed securety context switching
      sql/mysqld.cc:
        changed securety context switching
      sql/repl_failsafe.cc:
        changed securety context switching
      sql/set_var.cc:
        changed securety context switching
      sql/slave.cc:
        changed securety context switching
      sql/sp.cc:
        changed securety context switching
      sql/sp_head.cc:
        changed securety context switching
        in case of inability to switch context  we return error now
      sql/sp_head.h:
        changed securety context switching
      sql/sql_acl.cc:
        changed securety context switching
      sql/sql_acl.h:
        changed securety context switching
      sql/sql_base.cc:
        changed securety context switching
      sql/sql_class.cc:
        changed securety context switching
      sql/sql_class.h:
        changed securety context switching
      sql/sql_db.cc:
        changed securety context switching
      sql/sql_insert.cc:
        changed securety context switching
      sql/sql_parse.cc:
        changed securety context switching
      sql/sql_show.cc:
        changed securety context switching
      sql/sql_trigger.cc:
        changed securety context switching
      sql/sql_view.cc:
        changed securety context switching
      sql/sql_yacc.yy:
        changed securety context switching
      84f029a4
  11. 13 Sep, 2005 2 commits
    • unknown's avatar
      Added option --valgrind-mysqltest to mysql-test-run · f8f1c016
      unknown authored
      Added flag to Field::store(longlong) to specify if value is unsigned.
      This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
      Fixed warning from valgrind in CREATE ... SELECT
      Fixed double free of mysql.options if reconnect failed
      
      
      mysql-test/mysql-test-run.sh:
        Added option --valgrind-mysqltest to allow one to run mysqltest with valgrind
      mysql-test/r/bigint.result:
        Update results after fix for Field::store(longlong)
      mysql-test/r/range.result:
        Update results after fix for Field::store(longlong)
      mysql-test/r/strict.result:
        Update results after fix for Field::store(longlong)
        (This fixes some wrong results when storing things into bigint columns)
      mysql-test/r/type_ranges.result:
        Update results after fix for Field::store(longlong)
      mysql-test/t/bigint.test:
        Added testing for #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
      mysql-test/t/innodb.test:
        Removed comments affected by this bug fix
      mysql-test/t/mysqldump.test:
        Fixed result to not depend on existing config files
      mysql-test/t/range.test:
        0xff numbers are now unsigned
      mysql-test/t/strict.test:
        Added errors for things that previously (wrongly) succeeded
      sql-common/client.c:
        Fixed double free of mysql.options if reconnect failed
      sql/field.cc:
        Added flag to Field::store(longlong) to specify if value is unsigned
      sql/field.h:
        Added flag to Field::store(longlong) to specify if value is unsigned
      sql/field_conv.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/ha_ndbcluster.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/handler.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/item.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/item_sum.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/sp.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/sql_acl.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/sql_help.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/sql_show.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/sql_table.cc:
        Fixed varning from valgrind
      sql/sql_udf.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/tztime.cc:
        Fixed calls to Field::store(longlong,flag)
      sql/unireg.cc:
        Fixed calls to Field::store(longlong,flag)
      f8f1c016
    • unknown's avatar
      Fix for Bug #13124 Stored Procedure using SELECT INTO crashes server · dd516423
      unknown authored
      mysql-test/r/sp.result:
        added a test
      mysql-test/t/sp.test:
        corrected result file
      sql/item.cc:
        check for NULL value before copying string
      dd516423
  12. 09 Sep, 2005 2 commits
    • unknown's avatar
      after merge fix · 27eeeab8
      unknown authored
      27eeeab8
    • unknown's avatar
      Bug#12817 SHOW STATUS now blob fields · acf8d0f4
      unknown authored
         This fix is cancellation of ChangeSet
         1.2329 05/07/12 08:35:30 reggie@linux.site +8 -0
         Bug 7142  Show Fields from fails using Borland's dbExpress interface
         The reason is we can't fix bug#7142 without
         breaking of existing applications/APIs that worked fine with earlier 4.1
         bug 7142 is fixed in 5.0
      
      
      
      
      mysql-test/r/ps_1general.result:
        Bug #12817 SHOW STATUS now blob fields
      mysql-test/r/ps_2myisam.result:
        Bug #12817 SHOW STATUS now blob fields
      mysql-test/r/ps_3innodb.result:
        Bug #12817 SHOW STATUS now blob fields
      mysql-test/r/ps_4heap.result:
        Bug #12817 SHOW STATUS now blob fields
      mysql-test/r/ps_5merge.result:
        Bug #12817 SHOW STATUS now blob fields
      sql/item.cc:
        Bug #12817 SHOW STATUS now blob fields
      sql/sql_show.cc:
        Bug #12817 SHOW STATUS now blob fields
      tests/mysql_client_test.c:
        Bug #12817 SHOW STATUS now blob fields
      acf8d0f4
  13. 08 Sep, 2005 1 commit
  14. 07 Sep, 2005 2 commits
    • unknown's avatar
      item.cc: · d319c8ff
      unknown authored
        Fix for fix bug#12922.
      
      
      sql/item.cc:
        Fix for fix bug#12922.
      d319c8ff
    • unknown's avatar
      Fix bug #12922 if(sum(),...) with group from view returns wrong results · 792221e3
      unknown authored
      Fields of view represented by Item_direct_view_ref. When complex expression
      such as if(sum()>...,...) is splited in simpler parts by refs was ignored.
      Beside this direct ref doesn't use it's result_field and thus can't store
      it's result in tmp table which is needed for sum() ... group.
      All this results in reported bug.
      
      Item::split_sum_func2() now converts Item_direct_view_ref to Item_ref to
      make fields from view being storable in tmp table.
      
      
      sql/item.h:
        Fix bug #12922 if(sum(),...) with group from view returns wrong results
        Added function ref_type() to distinguish Item_ref subclasses
      sql/item.cc:
        Fix bug #12922 if(sum(),...) with group from view returns wrong results
         Item::split_sum_func2() now converts Item_direct_view_ref to Item_ref to make fields from view being storable in tmp table.
      mysql-test/t/view.test:
        Test case for bug#12922 if(sum(),...) with group from view returns wrong results
      mysql-test/r/view.result:
        Test case for bug#12922 if(sum(),...) with group from view returns wrong results
      792221e3
  15. 02 Sep, 2005 2 commits
    • unknown's avatar
      Rename: · dc922213
      unknown authored
      - current_arena to stmt_arena: the thread may have more than one
      'current' arenas: one for runtime data, and one for the parsed 
      tree of a statement. Only one of them is active at any moment.
      - set_item_arena -> set_query_arena, because Item_arena was renamed to 
      Query_arena a while ago
      - set_n_backup_item_arena -> set_n_backup_active_arena;
      the active arena is the arena thd->mem_root and thd->free_list
      are currently pointing at.
      - restore_backup_item_arena -> restore_active_arena (with the same
      rationale)
      - change_arena_if_needed -> activate_stmt_arena_if_needed; this
      method sets thd->stmt_arena active if it's not done yet.
      
      
      sql/item.cc:
        Rename.
      sql/item_cmpfunc.cc:
        Rename.
      sql/item_func.cc:
        Rename.
      sql/item_subselect.cc:
        Rename.
      sql/item_subselect.h:
        Remove an unused forward declaration.
      sql/item_sum.h:
        Remove an unused forward declaration.
      sql/mysql_priv.h:
        Remove an unused forward declaration.
      sql/sp.cc:
        Rename.
      sql/sp_head.cc:
        Rename.
      sql/sql_base.cc:
        Rename.
      sql/sql_class.cc:
        Rename.
      sql/sql_class.h:
        Rename.
      sql/sql_lex.cc:
        Rename.
      sql/sql_parse.cc:
        Rename.
      sql/sql_prepare.cc:
        Rename.
      sql/sql_select.cc:
        Rename.
      sql/sql_show.cc:
        Rename.
      sql/sql_union.cc:
        Rename.
      sql/sql_view.cc:
        Rename.
      sql/table.cc:
        Rename.
      dc922213
    • unknown's avatar
      postmerge changes · 7e2024b4
      unknown authored
      mysql-test/t/lowercase_view.test:
        error code changed after merege
      mysql-test/t/view.test:
        error code changed after merege
      sql/item.cc:
        inline function used instead of frequently used expression
        removed old TODO
      sql/sql_base.cc:
        layoutfixed
        inline function used instead of frequently used expression
      sql/sql_insert.cc:
        inline function used instead of frequently used expression
      7e2024b4
  16. 01 Sep, 2005 1 commit
    • unknown's avatar
      Bug10213 mysqldump crashes when dumping VIEWs · 74ea939f
      unknown authored
       - Added testcase for this bug
       - Check if compact view format can be used
       - Clean up mysqld_show_create
      
      
      mysql-test/r/mysqldump.result:
        Updated test result
      mysql-test/t/mysqldump.test:
        Added testcase
      sql/item.cc:
        Check if compact format can be used
      sql/sql_select.cc:
        Check if compact format can be used
      sql/sql_show.cc:
        Cleanup of mysqld_show_create
         -remove extra invocation of view_store_create_info
         -Remove unused vars
         -Remove unused codes
        Check if compact show view format can be used 
          - if user has db of this view as current db
          - if this view only references table inside it's own db
      sql/table.h:
        Add variable for compact_view_format indicator
      74ea939f
  17. 31 Aug, 2005 1 commit
    • unknown's avatar
      create.test, create.result, sql_select.cc, item.cc: · c6b54efe
      unknown authored
        After merge fix for bug #12537
      
      
      sql/item.cc:
        After merge fix for bug #12537
      sql/sql_select.cc:
        After merge fix for bug #12537
      mysql-test/r/create.result:
        After merge fix for bug #12537
      mysql-test/t/create.test:
        After merge fix for bug #12537
      c6b54efe
  18. 30 Aug, 2005 1 commit
    • unknown's avatar
      Fix bug #12537 UNION produces longtext instead of varchar · 033faf72
      unknown authored
      Item::tmp_table_field_from_field_type() and create_tmp_field_from_item()
      was converting string field to blob depending on byte-wise length instead of
      character length, which results in converting valid varchar string with
      length == 86 to longtext.
      
      Made that functions above take into account max width of character when
      converting string fields to blobs.
      
      
      sql/item.cc:
        Fix bug #12537 UNION produces longtext instead of varchar
        Item::tmp_table_field_from_field_type() now taking into account max char width when creating tmp field for string fields.
      sql/sql_select.cc:
        Fix bug #12537 UNION produces longtext instead of varchar
         create_tmp_field_from_item()now taking into account max char width when creating tmp field for string fields.
      mysql-test/r/create.result:
        Test case for bug #12537 UNION produces longtext instead of varchar
      mysql-test/t/create.test:
        Test case for bug #12537 UNION produces longtext instead of varchar
      033faf72
  19. 29 Aug, 2005 1 commit
    • unknown's avatar
      ctype_utf8.result, ctype_utf8.test, item.cc: · 593f03d9
      unknown authored
        Bug#12371 executing prepared statement fails (illegal mix of collations)
        After review fixes.
      
      
      sql/item.cc:
        Bug#12371 executing prepared statement fails (illegal mix of collations)
        After review fixes.
      mysql-test/t/ctype_utf8.test:
        Bug#12371 executing prepared statement fails (illegal mix of collations)
        After review fixes.
      mysql-test/r/ctype_utf8.result:
        Bug#12371 executing prepared statement fails (illegal mix of collations)
        After review fixes.
      593f03d9
  20. 26 Aug, 2005 1 commit
    • unknown's avatar
      Slightly amended Monty's SP replication code cleanup patch · 9bc3976c
      unknown authored
      sql/item.cc:
        Code cleanup
      sql/item.h:
        Code cleanup
      sql/log.cc:
        Added comments
      sql/sp_head.cc:
        Code cleanup patch from Monty: 
        in subst_spvars()
        - Move local variables first in block
        - Use res|= instead of res |=
        - Use strmake() instead of alloc + memcpy
        Added:
        - Fail the query if we don't have enough memory to produce a binlog-suitable query string: 
          if we're so low on memory we're likely to fail the query anyway, and failing now removes
          the need for hack with THD::query_str_binlog_suitable.
      sql/sql_class.cc:
        Remove THD::query_str_binlog_unsuitable
      sql/sql_class.h:
        Remove THD::query_str_binlog_unsuitable
      sql/sql_delete.cc:
        Remove THD::query_str_binlog_unsuitable
      sql/sql_insert.cc:
        Remove THD::query_str_binlog_unsuitable
      sql/sql_parse.cc:
        Code cleanup
      sql/sql_update.cc:
        Remove THD::query_str_binlog_unsuitable
      9bc3976c
  21. 25 Aug, 2005 2 commits
    • unknown's avatar
      Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs. · 8a5e5274
      unknown authored
      "Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
      The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.
      
      
      mysql-test/r/rpl_sp.result:
        Fix for BUG#12335: updated test cases/results
      mysql-test/t/rpl_sp.test:
        Fix for BUG#12335: updated test cases/results
      sql/item.cc:
        Fix for BUG#12335 (SP replication): 
         - Added Item_name_const 'function'
         - Addede 'delete reuse' to call dtor on item reuse
      sql/item.h:
        Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' + code cleanup
      sql/item_create.cc:
         Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
      sql/item_create.h:
         Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
      sql/item_func.cc:
        Fix for BUG#12335 (SP replication) : binary log is now constrolled from within execute_function.
      sql/lex.h:
        Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
      sql/log.cc:
        Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
        one to temporary disable binlogging but collect a 'union' information about binlog write
        calls.
      sql/mysql_priv.h:
        Fix for BUG#12335 (SP replication)
      sql/sp_head.cc:
        Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
        StoredRoutinesBinlogging for details
      sql/sp_head.h:
        Comments added
      sql/sp_pcontext.h:
        Comments added
      sql/sp_rcontext.h:
        Comments added
      sql/sql_class.cc:
        Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
        StoredRoutinesBinlogging for details
      sql/sql_class.h:
        Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
        one to temporary disable binlogging but collect a 'union' information about binlog write
        calls.
      sql/sql_delete.cc:
        Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
      sql/sql_insert.cc:
        Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
      sql/sql_lex.cc:
        Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
        the tokenizer.
      sql/sql_lex.h:
        Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
        the tokenizer.
      sql/sql_parse.cc:
        Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
        StoredRoutinesBinlogging for details
      sql/sql_update.cc:
        Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
      sql/sql_yacc.yy:
        Fix for BUG#12335 (SP replication) : When creating Item_splocal, remember where it is located
        in the query.
      8a5e5274
    • unknown's avatar
      Fix Bug#11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO query" · d29df564
      unknown authored
      mysql-test/r/sp.result:
        update result
      mysql-test/t/sp.test:
        Add test for Bug #11333 "Stored Procedure: Memory blow up on repeated SELECT ... INTO query"
      sql/item.cc:
        we should call destructors for Items before reuse
      sql/item.h:
        Add new method and constructor for Item_string.
      sql/sp_head.cc:
        String allocation should be done on the system heap for now.
      d29df564
  22. 19 Aug, 2005 1 commit
    • unknown's avatar
      Bug#11338 Fixes from review (identical functionality). · 1b970e94
      unknown authored
      include/my_sys.h:
        Fixes from review (use version in log_event.cc instead)
      mysql-test/r/ctype_cp932.result:
        Updated test for bug#11338 (logging of prepared statement w/ blob type)
      mysql-test/t/ctype_cp932.test:
        udpated test for bug#11338 (logging of prepared statement w/ blob type)
      mysys/charset.c:
        Fixes from review (use version in log_event.cc instead)
      sql/item.cc:
        Fixes from review (store character_set_client differently so that
        fix can be merged forward to 5.0)
      sql/item.h:
        Fixes from review
      sql/log_event.cc:
        Fixes from review, str_to_hex is now used by item.cc
      sql/log_event.h:
        Added prototype for str_to_hex (now used by item.cc)
      sql/sql_prepare.cc:
        Fixes from review, store character_set_client differently so that 
        Item_param::query_val_str can use it.
      1b970e94
  23. 17 Aug, 2005 1 commit
    • unknown's avatar
      BUG#11338 (logging of prepared statement w/ blob type) · a29b1d71
      unknown authored
      In cp932, '\' character can be the second byte in a 
      multi-byte character stream. This makes it difficult to use
      mysql_escape_string. Added flag to indicate which languages allow
      '\' as second byte of multibyte sequence so that when putting a prepared
      statement into the binlog we can decide at runtime whether hex encoding
      is really needed.
      
      
      include/m_ctype.h:
        Added bool to indicate character sets which allow '\' as the second
        byte of a multibyte character set (currently only cp932). For these
        character sets, escaping with '\' is dangerous and leads to corruption
        in replication.
      include/my_sys.h:
        Add function to enocde a string as hex with no prefix (bare)
      mysys/charset.c:
        Add function to encode string as hex with no prefix (bare).
      sql/item.cc:
        Check the connection character set to see if escape_string_for_mysql
        is safe, or if character set requires unambiguous (hex) encoding
      sql/item.h:
        Pass thd to query_val_str for access to charset()
      sql/sql_prepare.cc:
        Pass thd to query_val_str.
      strings/ctype-big5.c:
        Add escape_with_backslash_is_dangerous flag.
      strings/ctype-bin.c:
        Add escape_with_backslash_is_dangerous flag
      strings/ctype-cp932.c:
        Add escape_with_backslash_is_dangerous flag.
      strings/ctype-czech.c:
        Add escape_with_backslash_is_dangerous flag.
      strings/ctype-euc_kr.c:
        Add escape_with_backslash_is_dangerous flag.
      strings/ctype-extra.c:
        Add escape_with_backslash_is_dangerous flag.
      strings/ctype-gb2312.c:
        Add escape_with_backslash_is_dangerous flag.
      strings/ctype-gbk.c:
        Added escape_with_backslash_is_dangerous flag.
      strings/ctype-latin1.c:
        Added escape_with_backslash_is_dangerous flag.
      strings/ctype-sjis.c:
        Added escape_with_backslash_is_dangerous flag.
      strings/ctype-tis620.c:
        Added esacpe_with_backslash_character_is_dangerous flag.
      strings/ctype-uca.c:
        Added escape_with_backslash_is_dangerous flag.
      strings/ctype-ucs2.c:
        Added escape_with_backslash_is_dangerous.
      strings/ctype-ujis.c:
        Added escape_with_backslash_is_dangerous flag.
      strings/ctype-utf8.c:
        Added escape_with_backslash_is_dangerous.
      strings/ctype-win1250ch.c:
        Added escape_with_backslash_is_dangerous.
      a29b1d71
  24. 12 Aug, 2005 1 commit
    • unknown's avatar
      Implementation of WL#2486 - · 7517d7e1
      unknown authored
      "Process NATURAL and USING joins according to SQL:2003".
      
      * Some of the main problems fixed by the patch:
        - in "select *" queries the * expanded correctly according to
          ANSI for arbitrary natural/using joins
        - natural/using joins are correctly transformed into JOIN ... ON
          for any number/nesting of the joins.
        - column references are correctly resolved against natural joins
          of any nesting and combined with arbitrary other joins.
      
      * This patch also contains a fix for name resolution of items
        inside the ON condition of JOIN ... ON - in this case items must
        be resolved only against the JOIN operands. To support such
        'local' name resolution, the patch introduces a stack of
        name resolution contexts used at parse time.
      
      NOTICE:
      - This patch is not complete in the sense that
        - there are 2 test cases that still do not pass -
          one in join.test, one in select.test. Both are marked
          with a comment "TODO: WL#2486".
        - it does not include a new test specific for the task
      
      
      mysql-test/include/ps_query.inc:
        Adjusted according to standard NATURAL/USING join semantics.,
      mysql-test/r/bdb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/derived.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/errors.result:
        The column as a whole cannot be resolved, so different error message.
      mysql-test/r/fulltext.result:
        Adjusted according to standard JOIN ... ON semantics =>
        the ON condition can refer only to the join operands.
      mysql-test/r/fulltext_order_by.result:
        More detailed error message.
      mysql-test/r/innodb.result:
        Adjusted according to standard NATURAL/USING join semantics.
        This test doesn't pass completetly yet!
      mysql-test/r/insert_select.result:
        More detailed error message.
      mysql-test/r/join.result:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one test case that still fails, and it is
        commeted out and marked with WL#2486 in the test file.
      mysql-test/r/join_crash.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/join_nested.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/join_outer.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/multi_update.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/null_key.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/order_by.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_2myisam.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_3innodb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_4heap.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_5merge.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_6bdb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/ps_7ndb.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/select.result:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one failing test case which is commented with
        WL#2486 in the test file.
      mysql-test/r/subselect.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/type_ranges.result:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/r/union.result:
        More detailed error message.
      mysql-test/t/bdb.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/errors.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/fulltext.test:
        Adjusted according to standard JOIN ... ON semantics =>
        the ON condition can refer only to the join operands.
      mysql-test/t/fulltext_order_by.test:
        More detailed error message.
      mysql-test/t/innodb.test:
        Adjusted according to standard NATURAL/USING join semantics.
        This test doesn't pass completetly yet!
      mysql-test/t/insert_select.test:
        More detailed error message.
      mysql-test/t/join.test:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one test case that still fails, and it is
        commeted out and marked with WL#2486 in the test file.
      mysql-test/t/join_crash.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/join_nested.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/join_outer.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/null_key.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/order_by.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/select.test:
        Adjusted according to standard NATURAL/USING join semantics.
        
        NOTICE: there is one test case that still fails, and it is
        commeted out and marked with WL#2486 in the test file.
      mysql-test/t/subselect.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/type_ranges.test:
        Adjusted according to standard NATURAL/USING join semantics.
      mysql-test/t/union.test:
        More detailed error message.
      sql/item.cc:
        - extra parameter to find_field_in_tables
        - find_field_in_real_table renamed to find_field_in_table
        - fixed comments/typos
      sql/item.h:
        - added [first | last]_name_resolution_table to class
          Name_resolution_context
        - commented old code
        - standardized formatting
      sql/mysql_priv.h:
        - refactored the find_field_in_XXX procedures,
        - added a new procedure for natural join table references,
        - renamed the find_field_in_XXX procedures to clearer names
      sql/sp.cc:
        - pass the top-most list of the FROM clause to setup_tables
        - extra parameter to find_field_in_tables
      sql/sql_acl.cc:
        - renamed find_field_in_table => find_field_in_table_ref
        - extra parameter to find_field_in_table_ref
        - commented old code
      sql/sql_base.cc:
        This file contains the core of the implementation of the processing
        of NATURAL/USING joins (WL#2486).
        - added many comments to old code
        - refactored the group of find_field_in_XXX procedures, and added a
          new procedure for natural joins. There is one find_field_in_XXX procedure
          per each type of table reference (stored table, merge view, or natural
          join); one meta-procedure that selects the correct one depeneding on the
          table reference; and one procedure that goes over a list of table
          referenes.
        - NATURAL/USING joins are processed through the procedures:
            mark_common_columns, store_natural_using_join_columns,
            store_top_level_join_columns, setup_natural_join_row_types.
          The entry point to processing NATURAL/USING joins is the
          procedure 'setup_natural_join_row_types'.
        - Replaced the specialized Field_iterator_XXX iterators with one
          generic iterator over the fields of a table reference.
        - Simplified 'insert_fields' and 'setup_conds' due to encapsulation of
          the processing of natural joins in a separate set of procedures.
      sql/sql_class.h:
        - Commented old code.
      sql/sql_delete.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_help.cc:
        - pass the end name resolution table to find_field_in_tables
        - adjust the list of tables for name resolution
      sql/sql_insert.cc:
        - Changed the code that saves and restores the current context to
          support the list of tables for name resolution -
          context->first_name_resolution_table, and
          table_list->next_name_resolution_table.
          Needed to support an ugly trick to resolve inserted columns only in
          the first table.
        - Added Name_resolution_context::[first | last]_name_resolution_table.
        - Commented old code
      sql/sql_lex.cc:
        - set select_lex.parent_lex correctly
        - set correct state of the current name resolution context
      sql/sql_lex.h:
        - Added a stack of name resolution contexts to support local
          contexts for JOIN ... ON conditions.
        - Commented old code.
      sql/sql_load.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_olap.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_parse.cc:
        - correctly set SELECT_LEX::parent_lex
        - set the first table of the current name resoltion context
        - added support for NATURAL/USING joins
        - commented old code
      sql/sql_select.cc:
        - Pass the FROM clause to setup_tables.
        - Pass the end table to find_field_in_tables
        - Improved comments
      sql/sql_show.cc:
        - Set SELECT_LEX::parent_lex.
      sql/sql_update.cc:
        - Pass the FROM clause to setup_tables.
      sql/sql_yacc.yy:
        - Added support for a stack of name resolution contexts needed to
          implement name resolution for JOIN ... ON. A context is pushed
          for each new JOIN ... ON, and popped afterwards.
        - Added support for NATURAL/USING joins.
      sql/table.cc:
        - Added new class Natural_join_column to hide the heterogeneous
          representation of column references for stored tables and for
          views.
        - Added a new list TABLE_LIST::next_name_resolution_table to
          support name resolution with NATURAL/USING joins. Also added
          other members to TABLE_LIST to support NATURAL/USING joins.
        - Added a generic iterator over the fields of table references
          of various types - class Field_iterator_table_ref
      sql/table.h:
        - Added new class Natural_join_column to hide the heterogeneous
          representation of column references for stored tables and for
          views.
        - Added a new list TABLE_LIST::next_name_resolution_table to
          support name resolution with NATURAL/USING joins. Also added
          other members to TABLE_LIST to support NATURAL/USING joins.
        - Added a generic iterator over the fields of table references
          of various types - class Field_iterator_table_ref
      tests/mysql_client_test.c:
        Adjusted according to standard NATURAL JOIN syntax.
      7517d7e1
  25. 08 Aug, 2005 1 commit
    • unknown's avatar
      item.cc: · b9ffa4db
      unknown authored
        After review fix
      
      
      sql/item.cc:
        After review fix
      b9ffa4db
  26. 06 Aug, 2005 1 commit
    • unknown's avatar
      Bug#12371 executing prepared statement fails (illegal mix of collations) · c03d28b8
      unknown authored
      item.cc:
      item.h:
        Adding Item_param::safe_charset_converter,
        not to return collation mix error if
        parameter can be converted into operation
        character set.
      
      ctype_utf8.result:
        adding test case
      ctype_utf8.test:
        adding test case
      
      
      sql/item.h:
        Bug #12371 executing prepared statement fails (illegal mix of collations)
        Adding Item_param::safe_charset_converter,
        not to returm collation mix error if
        parameter can be converted into operation
        character set.
      sql/item.cc:
        Bug #12371 executing prepared statement fails (illegal mix of collations)
      mysql-test/t/ctype_utf8.test:
        adding test case
      mysql-test/r/ctype_utf8.result:
        adding
      c03d28b8
  27. 04 Aug, 2005 1 commit
    • unknown's avatar
      grant.result, grant.test: · 9e3562d7
      unknown authored
        fixing tests accordingly
      item.cc:
        Bug #10892 user variables not auto cast for comparisons
        When mixing strings with different character sets,
        and coercibility is the same, we allow conversion
        if one character set is superset for other character set.
      
      
      sql/item.cc:
        Bug #10892 user variables not auto cast for comparisons
        When mixing strings with different character sets,
        and coercibility is the same, we allow conversion
        if one character set is superset for other character set.
      mysql-test/t/grant.test:
        fixing tests accordingly
      mysql-test/r/grant.result:
        fixing tests accordingly
      9e3562d7
  28. 29 Jul, 2005 1 commit
    • unknown's avatar
      Ensure we free all items for prepared statements · 90b2daa7
      unknown authored
      Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test
      Note that test 'variables.test' fails.
      This will be fixed when Jimw pushes the fix for Bug 10351
      
      
      mysys/default.c:
        Fixed typo
      sql/item.cc:
        More debugging information
      sql/sql_prepare.cc:
        More debugging information
        Ensure we free all items for prepared statements
        Before the fix in ~Prepared_statments we got a memory leak when executing mysql_client_test.test
      90b2daa7
  29. 26 Jul, 2005 1 commit