1. 01 Oct, 2007 2 commits
  2. 29 Sep, 2007 1 commit
    • unknown's avatar
      view_grant.result, view_grant.test: · 854abbe9
      unknown authored
        Corrected test case for the bug#29908.
      
      
      mysql-test/t/view_grant.test:
        Corrected test case for the bug#29908.
      mysql-test/r/view_grant.result:
        Corrected test case for the bug#29908.
      854abbe9
  3. 28 Sep, 2007 4 commits
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 614cf6ad
      unknown authored
      into  moonbone.local:/work/27990-bug-5.0-opt-mysql
      
      
      sql/field.cc:
        Auto merged
      sql/sql_select.cc:
        Auto merged
      tests/mysql_client_test.c:
        Auto merged
      614cf6ad
    • unknown's avatar
      Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used. · acb3c59b
      unknown authored
      The change_to_use_tmp_fields function leaves the orig_table member of an
      expression's tmp table field filled for the new Item_field being created.
      Later orig_table is used by the Field::make_field function to provide some
      info about original table and field name to a user. This is ok for a field
      but for an expression it should be empty.
      
      The change_to_use_tmp_fields function now resets orig_table member of
      an expression's tmp table field to prevent providing a wrong info to a user.
      The Field::make_field function now resets the table_name and the org_col_name
      variables when the orig_table is set to 0.
      
      
      sql/field.cc:
        Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used.
        The Field::make_field function now resets the table_name and the org_col_name
        variables when the orig_table is set to 0.
      sql/sql_select.cc:
        Bug#27990: Wrong info in MYSQL_FIELD struct members when a tmp table was used.
        The change_to_use_tmp_fields function now resets orig_table member of
        an expression's tmp table field to prevent providing a wrong info to a user.
      tests/mysql_client_test.c:
        The test case for the bug#21635 is altered to test behavior on both const and
        non-const tables.
      acb3c59b
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · ef89cecf
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/autopush/B30587-5.0-opt
      
      
      sql/item_func.cc:
        Auto merged
      ef89cecf
    • unknown's avatar
      Bug #30587: mysql crashes when trying to group by TIME div NUMBER · 17b09640
      unknown authored
      When calculating the result length of an integer DIV function 
      the number of decimals was used without checking the result type
      first. Thus an uninitialized number of decimals was used for some 
      types. This caused an excessive amount of memory to be allocated 
      for the field's buffer and crashed the server.
      
       
      Fixed by using the number of decimals only for data types that 
      can have decimals and thus have valid decimals number.
      
      
      mysql-test/r/func_math.result:
        Bug #30587: test case
      mysql-test/t/func_math.test:
        Bug #30587: test case
      sql/item_func.cc:
        Bug #30587: Don't use decimals on a type that doesn't have them.
      17b09640
  4. 27 Sep, 2007 5 commits
  5. 24 Sep, 2007 1 commit
    • unknown's avatar
      Bug #28702: VIEWs defined with USE/FORCE KEY ignore that request · 6c3aa88e
      unknown authored
      When storing the VIEW the CREATE VIEW command is reconstructed 
      from the parse tree. While constructing the command string
      the index hints specified should also be printed.
      Fixed by adding code to print the index hints when printing a 
      table in the FROM clause.
      
      
      mysql-test/r/view.result:
        Bug #28702: test case
      mysql-test/t/view.test:
        Bug #28702: test case
      sql/sql_select.cc:
        Bug #28702: preserve index hints in a VIEW definition.
      sql/table.h:
        Bug #28702: preserve index hints in a VIEW definition.
      6c3aa88e
  6. 22 Sep, 2007 4 commits
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · b85a512e
      unknown authored
      into  macbook.local:/Users/kgeorge/mysql/autopush/B28701-merged-5.0-opt
      
      b85a512e
    • unknown's avatar
      Merge macbook.local:/Users/kgeorge/mysql/work/B28701-5.0-opt · 92052e4f
      unknown authored
      into  macbook.local:/Users/kgeorge/mysql/work/B28701-merged-5.0-opt
      
      
      sql/sql_view.cc:
        Auto merged
      mysql-test/r/view.result:
        merge with 5.0-opt
      mysql-test/t/view.test:
        merge with 5.0-opt
      92052e4f
    • unknown's avatar
      Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 9f7d7c8f
      unknown authored
      into  sunlight.local:/local_work/27216-bug-5.0-opt-mysql
      
      
      sql/sql_insert.cc:
        Auto merged
      9f7d7c8f
    • unknown's avatar
      Bug#27216: functions with parameters of different date types may return wrong · f8321b5a
      unknown authored
      type of the result.
      
      There are several functions that accept parameters of different types.
      The result field type of such functions was determined based on
      the aggregated result type of its arguments. As the DATE and the DATETIME
      types are represented by the STRING type, the result field type
      of the affected functions was always STRING for DATE/DATETIME arguments.
      The affected functions are COALESCE, IF, IFNULL, CASE, LEAST/GREATEST, CASE.
      
      Now the affected functions aggregate the field types of their arguments rather
      than their result types and return the result of aggregation as their result
      field type.
      The cached_field_type member variable is added to the number of classes to
      hold the aggregated result field type.
      The str_to_date() function's result field type now defaults to the
      MYSQL_TYPE_DATETIME.
      The agg_field_type() function is added. It aggregates field types with help
      of the Field::field_type_merge() function.
      The create_table_from_items() function now uses the 
      item->tmp_table_field_from_field_type() function to get the proper field
      when the item is a function with a STRING result type.
      
      
      libmysql/libmysql.c:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The client library now accepts the NEWDATE type as a string.
      sql/item_cmpfunc.cc:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        Now the fix_length_and_dec functions of the
        Item_func_ifnull,Item_func_if, Item_func_case, Item_func_coalesce
        classes are use agg_field_type function to find out the type of their 
        result field.
      sql/item_cmpfunc.h:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The cached_field type is added to the Item_func_case, Item_func_if and
        Item_func_coalesce classes.
        The field_type function is added to the Item_func_ifnull, Item_func_if,
        Item_func_coalesce, Item_func_case classes.
      sql/item_func.cc:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The Item_func_min_max::fix_length_and_dec function now uses the agg_field_type
        function to find out the correct type of the result field.
      sql/item_func.h:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The cached_field_type variable is added to the Item_func_min_max class.
      sql/item_timefunc.cc:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The result of the str_to_date function now defaults to the
        DATETIME type.
      sql/mysql_priv.h:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The prototype of the agg_field_type function is added.
      sql/protocol.cc:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The Protocol_simple::store function is now used to store fields of NEWDATE type.
      sql/sql_insert.cc:
        Bug#27216: functions with parameters of different date types may return wrong
        type of the result.
        The create_table_from_items function now uses the
        tmp_table_field_from_field_type function to get field for items with the
        STRING result type.
      mysql-test/r/date_formats.result:
        A test case result corrected after fixing bug#27216.
      mysql-test/r/type_datetime.result:
        Added a test case for the bug#27216: functions with parameters of different
        date types may return wrong type of the result.
      mysql-test/t/type_datetime.test:
        Added a test case for the bug#27216: functions with parameters of different
        date types may return wrong type of the result.
      f8321b5a
  7. 21 Sep, 2007 1 commit
    • unknown's avatar
      Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT · b6333a8c
      unknown authored
      led to creating corrupted index.
      
      While execution of the  CREATE .. SELECT SQL_BUFFER_RESULT statement the 
      engine->start_bulk_insert function was called twice. On the first call
      On the first call MyISAM disabled all non-unique indexes and on the second
      call it decides to not re-enable them because all indexes was disabled.
      Due to this no indexes was actually created during CREATE TABLE thus
      producing crashed table.
      
      Now the select_inset class has is_bulk_insert_mode flag which prevents
      calling the start_bulk_insert function twice.
      The flag is set in the select_create::prepare, select_insert::prepare2
      functions and the select_insert class constructor.
      The flag is reset in the select_insert::send_eof function.
      
      
      mysql-test/t/insert_select.test:
        A test case is added for the bug#30384: Having SQL_BUFFER_RESULT option in the
        CREATE .. KEY(..) .. SELECT led to creating corrupted index.
      mysql-test/r/insert_select.result:
        A test case is added for the bug#30384: Having SQL_BUFFER_RESULT option in the 
        CREATE .. KEY(..) .. SELECT led to creating corrupted index.
      sql/sql_class.h:
        Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
        led to creating corrupted index.
        The is_bulk_insert_mode flag is added to the select_insert class.
      sql/sql_insert.cc:
        Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
        led to creating corrupted index.
        The is_bulk_insert_mode is set in the select_create::prepare, select_insert::prepare2
        functions and the select_insert class constructor.
        The flag is reset in the select_insert::send_eof function.
      b6333a8c
  8. 20 Sep, 2007 3 commits
    • unknown's avatar
      Bug#29908: A user can gain additional access through the ALTER VIEW. · b7142fa1
      unknown authored
      Non-definer of a view was allowed to alter that view. Due to this the alterer
      can elevate his access rights to access rights of the view definer and thus
      modify data which he wasn't allowed to modify. A view defined with
      SQL SECURITY INVOKER can't be used directly for access rights elevation.
      But a user can first alter the view SQL code and then alter the view to 
      SQL SECURITY DEFINER and thus elevate his access rights. Due to this
      altering a view with SQL SECURITY INVOKER is also prohibited.
      
      Now the mysql_create_view function allows ALTER VIEW only to the view
      definer or a super user. 
      
      
      mysql-test/t/view_grant.test:
        Added a test case for the bug#29908: A user can gain additional access through the
        ALTER VIEW.
        A test case was adjusted after fixfing bug#29908.
      mysql-test/r/view_grant.result:
        Added a test case for the bug#29908: A user can gain additional access through the
        ALTER VIEW.
      sql/sql_view.cc:
        Bug#29908: A user can gain additional access through the ALTER VIEW.
        Now the mysql_create_view function allows ALTER VIEW only to the view
        definer or a super user.
      b7142fa1
    • unknown's avatar
      result fix · bf3d46a8
      unknown authored
      bf3d46a8
    • unknown's avatar
      Bug#27747 database metadata doesn't return sufficient column default info · b7734724
      unknown authored
      added get_field_default_value() function which obtains default value from the field
      (used in store_create_info() & get_schema_column_record() functions)
      
      
      mysql-test/r/alter_table.result:
        result fix
      mysql-test/r/create.result:
        result fix
      mysql-test/r/ctype_collate.result:
        result fix
      mysql-test/r/ctype_recoding.result:
        result fix
      mysql-test/r/default.result:
        result fix
      mysql-test/r/gis.result:
        result fix
      mysql-test/r/grant.result:
        result fix
      mysql-test/r/information_schema.result:
        result fix
      mysql-test/r/key.result:
        result fix
      mysql-test/r/mysql.result:
        result fix
      mysql-test/r/ps_1general.result:
        result fix
      mysql-test/r/show_check.result:
        result fix
      mysql-test/r/sp.result:
        result fix
      mysql-test/r/type_enum.result:
        result fix
      mysql-test/r/type_ranges.result:
        result fix
      mysql-test/t/information_schema.test:
        test case
      b7734724
  9. 19 Sep, 2007 1 commit
  10. 15 Sep, 2007 1 commit
    • unknown's avatar
      select.test: · 6bcc6c25
      unknown authored
        Post-fix for bug#27695.
      
      
      mysql-test/t/select.test:
        Post-fix for bug#27695.
      6bcc6c25
  11. 14 Sep, 2007 10 commits
    • unknown's avatar
      Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 53b29922
      unknown authored
      into  devsrv-b.mysql.com:/data0/gshchepa/mysql-5.0-opt
      
      53b29922
    • unknown's avatar
      Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 49dee0e0
      unknown authored
      into  magare.gmz:/home/kgeorge/mysql/autopush/B31001-5.0-opt
      
      49dee0e0
    • unknown's avatar
      Bug #31001: ORDER BY DESC in InnoDB not working · 040da853
      unknown authored
      The optimizer sets index traversal in reverse order only if there are 
       used key parts that are not compared to a constant.
      However using the primary key as an ORDER BY suffix rendered the check
      incomplete : going in reverse order must still be used even if 
      all the parts of the secondary key are compared to a constant.
      
      Fixed by relaxing the check and set reverse traversal even when all
      the secondary index keyparts are compared to a const.
      Also account for the case when all the primary keys are compared to a
      constant.
      
      
      mysql-test/r/innodb_mysql.result:
        Bug #31001: test case
      mysql-test/t/innodb_mysql.test:
        Bug #31001: test case
      sql/sql_select.cc:
        Bug #31001: 
         - account for the case when all the primary key parts are compared
           to a constant
         - force test_if_skip_sort_order to go backwards over the key even 
           when the number of keyparts used is the same as the number of 
           keyparts equal to a constant. (because of the primary key 
           suffix).
      040da853
    • unknown's avatar
      Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · 02c8e132
      unknown authored
      into  mysql.com:/home/psergey/mysql-5.0-bug30324
      
      02c8e132
    • unknown's avatar
      BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results · e6026e22
      unknown authored
      - The bug was caused by COUNT(DISTINCT ...) code using Unique object in 
        a way that assumed that BIT(N) column occupies a contiguous space in
        temp_table->record[0] buffer. 
      - The fix is to make COUNT(DISTINCT ...) code instruct create_tmp_table to
        create temporary table with column of type BIGINT, not BIT(N).
      
      
      mysql-test/r/type_bit.result:
        BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results
        - Testcase
      mysql-test/t/type_bit.test:
        BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results
        - Testcase
      sql/item_sum.cc:
        BUG#30324: Grouping queries with COUNT(DISTINCT bit column) return wrong results
        - Make COUNT(DISTINCT ...) code instruct create_tmp_table to create 
          temporary table with BIGINT, not BIT(N) column.
      e6026e22
    • unknown's avatar
      Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0 · 2f274c35
      unknown authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
      
      2f274c35
    • unknown's avatar
      Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb · 5d828baf
      unknown authored
      into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
      
      5d828baf
    • unknown's avatar
      Merge devsrv-b.mysql.com:/users/gshchepa/mysql-5.0-opt · 7acfa94f
      unknown authored
      into  devsrv-b.mysql.com:/data0/gshchepa/mysql-5.0-opt
      
      7acfa94f
    • unknown's avatar
      Merge gshchepa@bk-internal.mysql.com:/users/gshchepa/mysql-5.0-opt · 5fad4405
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt-27695
      
      5fad4405
    • unknown's avatar
      Merge gleb.loc:/home/uchum/work/bk/5.0 · 2a089503
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      2a089503
  12. 13 Sep, 2007 5 commits
    • unknown's avatar
      Merge trift2.:/MySQL/M50/push-5.0 · 31132dc9
      unknown authored
      into  trift2.:/MySQL/M50/tmp-5.0
      
      31132dc9
    • unknown's avatar
      Fixed bug #27695. · ede3c722
      unknown authored
      Declaring an all space column name in the SELECT FROM DUAL or in a view
      leads to misleading warning message:
      "Leading spaces are removed from name ' '".
      
      The Item::set_name method has been modified to raise warnings like
      "Name ' ' has become ''" in case of the truncation of an all
      space identifier to an empty string identifier instead of the
      "Leading spaces are removed from name ' '" warning message.
      
      
      sql/item.cc:
        Fixed bug #27695.
        The Item::set_name method has been modified to raise warnings like
        "Name ' ' has become ''" in case of the truncation of an all
        space identifier to an empty string identifier instead of the
        "Leading spaces are removed from name ' '" warning message.
      sql/share/errmsg.txt:
        Fixed bug #27695.
      mysql-test/t/select.test:
        Added test case for bug #27695.
      mysql-test/r/select.result:
        Added test case for bug #27695.
      ede3c722
    • unknown's avatar
      Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb · 7082c70e
      unknown authored
      into  mysql.com:/windows/Linux_space/MySQL/mysql-5.0-ndb
      
      7082c70e
    • unknown's avatar
    • unknown's avatar
      Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt · e7bfb500
      unknown authored
      into  gleb.loc:/home/uchum/work/bk/5.0-opt
      
      e7bfb500
  13. 12 Sep, 2007 2 commits