Commit graph

878 commits

Author SHA1 Message Date
Alexey Botchkov
3886c3a46d Bug#53251 mysql_library_init fails on second execution with embedded library
thread-specific variables weren't set when we load error message files.

per-file comments:
  libmysqld/lib_sql.cc
Bug#53251      mysql_library_init fails on second execution with embedded library
      we need to call my_thread_init() once more. Normally it's called at the my_init()
      stage but that doesn't happen on the second my_init() call.

  sql/derror.cc
Bug#53251      mysql_library_init fails on second execution with embedded library
     use default errors for the embedded server.

  sql/mysqld.cc
Bug#53251      mysql_library_init fails on second execution with embedded library
        unregister server errors in clean_up(). Without it the error list contains
        that on the second mysql_server_init() which is not good.

  sql/set_var.cc
Bug#53251      mysql_library_init fails on second execution with embedded library
        sys_var::cleanup() call instead of the destructor

  sql/set_var.h
Bug#53251      mysql_library_init fails on second execution with embedded library
        sys_var::cleanup() introduced instead of the destructor
        
  sql/sys_vars.h
Bug#53251      mysql_library_init fails on second execution with embedded library
        Sys_var_charptr::cleanup() implemented
2010-09-02 23:37:04 +05:00
Alexey Botchkov
a334004420 Bug#54906 Inconsistent license of libmysqld
made libmysqld/Makefile.am to have same licence as libmysqld/CMakeLists.txt

per-file comments:
  libmysqld/Makefile.am
Bug#54906      Inconsistent license of libmysqld
        Added GPL license header instead of Library GPL.
2010-09-01 08:38:53 +05:00
Jon Olav Hauglid
5139bf6c8f Manual merge from mysql-5.5-bugfixing to mysql-5.5-runtime. 2010-08-18 13:29:04 +02:00
Mattias Jonsson
1be8280b84 merge 2010-08-16 16:27:25 +02:00
Mattias Jonsson
2b2c7ae6de Rename of sql_alter_table -> sql_alter and sql_table_maintenance -> sql_admin 2010-08-16 16:25:23 +02:00
Mattias Jonsson
7641dd7b4b merge 2010-08-16 14:58:38 +02:00
Mattias Jonsson
25ae81f133 Bug#49907: ALTER TABLE ... TRUNCATE PARTITION does not wait for
locks on the table

Fixing the partitioning specifics after TRUNCATE TABLE in
bug-42643 was fixed.

Reorganize of code to decrease the size of the giant switch
in mysql_execute_command, and to prepare for future parser
reengineering. Moved code into Sql_statement objects.

Updated patch according to davi's review comments.
2010-08-16 14:53:30 +02:00
Konstantin Osipov
4e935a5329 Extract reload_acl_and_cache() and flush_tables_with_read_lock()
into an own implementation file.
2010-08-13 13:51:48 +04:00
Alexander Nozdrin
13ec2a1625 Patch for Bug#55854 (MySQL AB should not be AUTHOR, copyright incorrect).
Fixing copyright text.
2010-08-12 19:19:57 +04:00
Davi Arnaut
e83f1d37c4 WL#5498: Remove dead and unused source code
Remove unused source code and associated paraphernalia.
2010-07-23 17:14:35 -03:00
Ramil Kalimullin
2ae6d370a9 Automerge. 2010-07-16 12:43:17 +04:00
Ramil Kalimullin
a9b8eb4255 Fix for bug #50667: The InnoDB plugin prevents initialization
of the "embedded" server

Problem: mysqltest_embedded failed to load ha_innodb_plugin library
on some platforms (due to some unresolved references).

Fix: on FreeBSD use -export-dynamic flag building mysqltest_embedded.
That allows to use its global symbols to resolve references in the
dynamically loaded plugin library.
2010-07-16 11:15:22 +04:00
Davi Arnaut
8fcaea9afb WL#5486: Remove code for unsupported platforms
Restore hack necessary to setup a libmysqld archive.
2010-07-15 15:44:15 -03:00
Davi Arnaut
8df20918d6 WL#5486: Remove code for unsupported platforms
Remove OS/2 specific code.
2010-07-15 08:33:27 -03:00
Davi Arnaut
b3d22cef93 WL#5486: Remove code for unsupported platforms
Remove MS-DOS specific code.
2010-07-15 08:16:06 -03:00
Davi Arnaut
f54a118249 WL#5486: Remove code for unsupported platforms
Remove Netware specific code.
2010-07-15 08:13:30 -03:00
Davi Arnaut
a10ae35328 Bug#34043: Server loops excessively in _checkchunk() when safemalloc is enabled
Essentially, the problem is that safemalloc is excruciatingly
slow as it checks all allocated blocks for overrun at each
memory management primitive, yielding a almost exponential
slowdown for the memory management functions (malloc, realloc,
free). The overrun check basically consists of verifying some
bytes of a block for certain magic keys, which catches some
simple forms of overrun. Another minor problem is violation
of aliasing rules and that its own internal list of blocks
is prone to corruption.

Another issue with safemalloc is rather the maintenance cost
as the tool has a significant impact on the server code.
Given the magnitude of memory debuggers available nowadays,
especially those that are provided with the platform malloc
implementation, maintenance of a in-house and largely obsolete
memory debugger becomes a burden that is not worth the effort
due to its slowness and lack of support for detecting more
common forms of heap corruption.

Since there are third-party tools that can provide the same
functionality at a lower or comparable performance cost, the
solution is to simply remove safemalloc. Third-party tools
can provide the same functionality at a lower or comparable
performance cost. 

The removal of safemalloc also allows a simplification of the
malloc wrappers, removing quite a bit of kludge: redefinition
of my_malloc, my_free and the removal of the unused second
argument of my_free. Since free() always check whether the
supplied pointer is null, redudant checks are also removed.

Also, this patch adds unit testing for my_malloc and moves
my_realloc implementation into the same file as the other
memory allocation primitives.
2010-07-08 18:20:08 -03:00
Alexander Nozdrin
bba0a92d03 Auto-merge from mysql-trunk-stage. 2010-06-21 17:08:16 +04:00
Daniel Fischer
9891642e77 merge 2010-06-18 17:04:15 +02:00
Konstantin Osipov
41d95c5049 A pre-requisite for WL#5419 "LOCK_open scalability:
make tdc_refresh_version an 
atomic counter".
Backport the trivial changes from mysql-trunk-iplus.
2010-06-10 15:43:32 +04:00
Jon Olav Hauglid
1af11051bf manual merge from mysql-trunk-bugfixing
Conflicts:
Text conflict in mysql-test/r/archive.result
Contents conflict in mysql-test/r/innodb_bug38231.result
Text conflict in mysql-test/r/mdl_sync.result
Text conflict in mysql-test/suite/binlog/t/disabled.def
Text conflict in mysql-test/suite/rpl_ndb/r/rpl_ndb_binlog_format_errors.result
Text conflict in mysql-test/t/archive.test
Contents conflict in mysql-test/t/innodb_bug38231.test
Text conflict in mysql-test/t/mdl_sync.test
Text conflict in sql/sp_head.cc
Text conflict in sql/sql_show.cc
Text conflict in sql/table.cc
Text conflict in sql/table.h
2010-06-06 13:19:29 +02:00
Alexander Barkov
56c3b98065 Bug#52520 Difference in tinytext utf column metadata
Problems:
      - regression (compating to version 5.1) in metadata for BLOB types
      - inconsistency between length metadata in server and embedded for BLOB types
      - wrong max_length calculation in items derived from BLOB columns
     @ libmysqld/lib_sql.cc
        Calculating length metadata in embedded similary to server version,
        using new function char_to_byte_length_safe().
     @ mysql-test/r/ctype_utf16.result
        Adding tests
     @ mysql-test/r/ctype_utf32.result
        Adding tests
     @ mysql-test/r/ctype_utf8.result
        Adding tests
     @ mysql-test/r/ctype_utf8mb4.result
        Adding tests
     @ mysql-test/t/ctype_utf16.test
        Adding tests
     @ mysql-test/t/ctype_utf32.test
        Adding tests
     @ mysql-test/t/ctype_utf8.test
        Adding tests
     @ mysql-test/t/ctype_utf8mb4.test
        Adding tests
     @ sql/field.cc
        Overriding char_length() for Field_blob:
        unlike in generic Item::char_length() we don't
        divide to mbmaxlen for BLOBs.
     @ sql/field.h
        - Making Field::char_length() virtual
        - Adding prototype for Field_blob::char_length()
     @ sql/item.h
        - Adding new helper function char_to_byte_length_safe()
        - Using new function
     @ sql/protocol.cc
        Using new function char_to_byte_length_safe().

    modified:
      libmysqld/lib_sql.cc
      mysql-test/r/ctype_utf16.result
      mysql-test/r/ctype_utf32.result
      mysql-test/r/ctype_utf8.result
      mysql-test/r/ctype_utf8mb4.result
      mysql-test/t/ctype_utf16.test
      mysql-test/t/ctype_utf32.test
      mysql-test/t/ctype_utf8.test
      mysql-test/t/ctype_utf8mb4.test
      sql/field.cc
      sql/field.h
      sql/item.h
      sql/protocol.cc
2010-06-02 16:23:50 +04:00
Davi Arnaut
3c279d9a5a Bug#42643: InnoDB does not support replication of TRUNCATE TABLE
The problem was that TRUNCATE TABLE didn't take a exclusive
lock on a table if it resorted to truncating via delete of
all rows in the table. Specifically for InnoDB tables, this
could break proper isolation as InnoDB ends up aborting some
granted locks when truncating a table.

The solution is to take a exclusive metadata lock before
TRUNCATE TABLE can proceed. This guarantees that no other
transaction is using the table.

Incompatible change: Truncate via delete no longer fails
if sql_safe_updates is activated (this was a undocumented
side effect).
2010-05-25 17:01:38 -03:00
Alexander Nozdrin
091bcacc79 Another incarnation of the patch for Bug#30708
(make relies GNU extentions). The patch was partially
backport from 6.0.

Original comment:
bug#30708: make relies GNU extensions.  Now that we no longer use
BitKeeper we can safely remove the SCCS handling with no loss of
functionality.
2010-05-19 17:00:23 +04:00
Jonathan Perkin
5b85121ca6 Changes to build using CMake according to existing release packages:
- Update/fix file layouts for each package type, add new types for
   native package formats including deb, rpm and svr4.

 - Build all plugins, including debug versions

 - Update compiler flags to match current release

 - Add missing @VAR@ expansions

 - Install correct mysqclient library symlinks

 - Fix icc/ia64 builds

 - Fix install of libmysqld-debug

 - Don't include mysql_embedded

 - Remove unpackaged manual pages to avoid missing files warnings

 - Don't install mtr's test suite
2010-05-12 12:51:23 +01:00
Daniel Fischer
b1109f0331 merge 2010-04-30 13:36:57 +02:00
Kent Boortz
d110132ffc Exclude "mysql_embedded" from being installed or part of a binary
package, is more of a linktest of the embedded library.
2010-04-28 11:25:11 +02:00
Daniel Fischer
50edf454b1 Merge 2010-04-21 14:58:09 +02:00
Konstantin Osipov
53fecff1ef Backport of:
ChangeSet@1.2703, 2007-12-07 09:35:28-05:00, cmiller@zippy.cornsilk.net +40 -0
Bug#13174: SHA2 function
Patch contributed from Bill Karwin, paper unnumbered CLA in Seattle

Implement SHA2 functions.

Chad added code to make it work with YaSSL.  Also, he removed the 
(probable) bug of embedded server never using SSL-dependent 
functions.  (libmysqld/Makefile.am didn't read ANY autoconf defs.)

Function specification:
  SHA2( string cleartext, integer hash_length ) 
    -> string hash, or NULL
where hash_length is one of 224, 256, 384, or 512.  If either is 
NULL or a length is unsupported, then the result is NULL.  The 
resulting string is always the length of the hash_length parameter
or is NULL.

Include the canonical hash examples from the NIST in the test
results.
---
Polish and address concerns of reviewers.
2010-04-13 19:04:45 +04:00
Jonathan Perkin
f0856cc114 Try a bunch of fixes. 2010-03-31 23:52:49 +02:00
Mats Kindahl
e409d6f69c WL#5030: Split and remove mysql_priv.h
This patch:

- Moves all definitions from the mysql_priv.h file into
  header files for the component where the variable is
  defined
- Creates header files if the component lacks one
- Eliminates all include directives from mysql_priv.h
- Eliminates all circular include cycles
- Rename time.cc to sql_time.cc
- Rename mysql_priv.h to sql_priv.h
2010-03-31 16:05:33 +02:00
Jonathan Perkin
80fd4bef18 Apply wlad fixes from mysql-next-mr-bugfixing 2010-03-31 11:40:02 +02:00
Vladislav Vaintroub
78a965861a Bug #52149 - packaging differences in CMake build
Corrected some packaging bugs:
- install mysqlservices library
- install libmysqlclient_r.so.{16,16.0.0} as links
  to libmysqlclient.so
- install libmysqld-debug.a
- install my_safe_process, my_safe_kill and
  symlinks to mysql-test-run.pl (mtr, mysql-test-run)
  into correct place ${INSTALL_MYSQLTESTDIR}
2010-03-17 19:56:22 +01:00
Alexander Barkov
06ca4ae33d Mergine from mysql-next-me 2010-02-27 11:43:32 +04:00
Vladislav Vaintroub
53771dd1a2 Bug#43201: Post-fix. Set thread stack address at the start of each query.
Reason: implementation of send/reap in mysqltest uses the same "embedded" connection in a thread different from current, so thread stack has to change when connection is used in different  OS thread..
2010-02-23 20:25:38 +01:00
Vladislav Vaintroub
56700fd38c Install static client and embedded debug libraries 2010-02-20 20:40:03 +01:00
Vladislav Vaintroub
6efcf9e3b6 add_executable => mysql_add_executable (just for uniformity) 2010-02-20 08:58:18 +01:00
Vladislav Vaintroub
d4b10d1fd5 merge 2010-02-16 23:19:47 +01:00
Alexander Barkov
d59c06d96c A post-fix for WL#2649 Number-to-string conversion
Fixing problems discovered by "mtr --embedded" and "mtr --ps"


  @ libmysqld/lib_sql.cc
   "mtr --embedded --do-test=ps" failed.
   Applying a similar change to the one previously done in protocol.cc,
   to make embedded version work the same with client/server version.
   (a bug in the WL#2649 patch)

  @ mysql-test/include/ctype_numconv.inc
  @ mysql-test/r/ctype_binary.result
  @ mysql-test/r/ctype_cp1251.result
  @ mysql-test/r/ctype_latin1.result
  @ mysql-test/r/ctype_ucs.result

  - Changing tinyint(30) to tinyint(4)
    due to problems with "mtr --ps"
    Possibly a bug in libmysql.cc, in function fetch_long_with_conversion().
    Zerofill buffer is to short.

  - Commenting tests with get_lock/release_lock
    "mtr --ps" failed for some reasons in ctype_cp1251.
2010-02-11 18:28:28 +04:00
Vladislav Vaintroub
890c52d889 Add components to INSTALL, some eraly Wix support 2010-02-10 20:23:24 +01:00
Konstantin Osipov
9c030fe508 Merge next-mr -> next-4284. 2010-02-06 13:28:06 +03:00
Konstantin Osipov
ad0f1f8021 Merge next-mr -> next-4284. 2010-02-05 01:08:08 +03:00
Konstantin Osipov
f949e1b80f Merge next-mr -> next-4284. 2010-02-03 17:10:36 +03:00
Konstantin Osipov
b92ab41c5c Merge next-mr -> next-4284 2010-02-03 16:43:03 +03:00
Konstantin Osipov
0ce6d93f85 Merge next-mr -> next-4284. 2010-02-03 03:06:42 +03:00
Konstantin Osipov
c2fe19883e Merge next-mr -> next-4284.
Fix Bug#50555 "handler commands crash server in my_hash_first()"
as a post-merge fix (the new handler tests are not passing 
otherwise).
- in hash.c, don't call calc_hash if ! my_hash_inited().
- add tests and results for the test case for Bug#50555
2010-02-02 16:58:15 +03:00
Konstantin Osipov
2c6015e8dc Merge next-mr -> next-4284. 2010-02-02 02:22:16 +03:00
Vladislav Vaintroub
ebf2e76289 merge, add plugin/audit_null/CMakeLists.txt 2010-01-26 05:39:48 +01:00
Vladislav Vaintroub
1519d8ccd1 Fix smaller stuff: disable transitive linking for MERGE_LIBRARIES results,
compile embedded with PIC to allow linking with shared libraries
2010-01-25 02:52:32 +01:00
Sergey Vojtovich
ec59b40adc Merge backport of WL#3771 with mysql-next-mr. 2010-01-19 20:42:25 +04:00