Commit graph

77612 commits

Author SHA1 Message Date
Sergei Golubchik
9c089b04b3 TABLE_SHARE::free_frm_image() method to free the memory
allocated by the same allocator as in TABLE_SHARE::read_frm_image()
2013-04-09 16:18:51 +02:00
Sergei Golubchik
37379ef0ed limit frm size, when reading it in memory 2013-04-09 16:18:47 +02:00
Sergei Golubchik
e71cda83c6 cleanup: merge two mutually dependent function arguments into one,
eliminating reduncancy and a possibility of setting them to a pair of
invalid values.
2013-04-09 16:18:44 +02:00
Sergei Golubchik
336da6e270 cleanup 2013-04-09 16:18:37 +02:00
Sergei Golubchik
02c712aa54 * frm extra2 segment.
* persistent table versions in the extra2
* ha_archive::frm_compare using TABLE_SHARE::tabledef_version
* distinguish between "important" and "optional" extra2 frm values
* write engine-defined attributes (aka "table options") to extra2, not to extra,
  but still read from the old location, if they're found there.
2013-04-09 16:18:33 +02:00
Sergei Golubchik
f6168bb67b cleanup 2013-04-09 16:18:27 +02:00
Sergei Golubchik
f6108b1fab comments 2013-04-09 16:18:21 +02:00
Sergei Golubchik
b10937ea24 update the comment 2013-04-09 16:18:10 +02:00
Sergei Golubchik
13b7bcd5d4 sequence engine 2013-04-09 16:17:16 +02:00
Sergei Golubchik
2d788ff5ca test_sql_discovery storage engine
use it to test main test cases with need_full_discover_for_existence > 0
2013-04-09 16:07:35 +02:00
Sergei Golubchik
4853c7192d discovery using sql CREATE TABLE statement 2013-04-09 16:07:17 +02:00
Sergei Golubchik
474f45b3dc discover of table non-existance on drop 2013-04-09 16:06:54 +02:00
Sergei Golubchik
e06cb31719 CREATE TABLE and frm-less discovering engines.
Now CREATE TABLE does not write the frm file on disk,
if the engine can discover it
2013-04-09 15:57:09 +02:00
Sergei Golubchik
b3e70c4ae7 split mysql_create_frm() in create_frm_image() and writefrm() 2013-04-09 15:56:59 +02:00
Sergei Golubchik
cb5473cb2f write frm pieces contiguously, don't align them on a 4K boundary
(in partition_archive.test frm size goes down 16 times :)
2013-04-09 15:56:52 +02:00
Sergei Golubchik
e671cba9ed Instead of creating and writing frm into a file peacewise
(allocating and freeing buffers on the way), allocate
one frm buffer, prepare the frm image completely in memory,
and then write it down.
2013-04-09 15:56:43 +02:00
Sergei Golubchik
9ec326a8b1 cleanup frm creation:
* comments
* cosmetic changes, *(ptr+5) -> ptr[5]
* a couple of trivial functions -> inline
* remove unused argument from pack_header()
* create_frm() no longer creates frm file (the function used to prepare and
  fill a memory buffer and call my_create at the end. Now it only prepares
  a memory buffer). Renamed accordingly.
* don't call pack_screen twice, go for a smaller screen area in the first attempt
* remove useless calls to check_duplicate_warning()
* don't write unireg screens to .frm files
* remove make_new_entry(), it's basically dead code, always calculating
  and writing into frm the same string value. replace the function call
  with the constant string.
2013-04-09 15:56:28 +02:00
Sergei Golubchik
84b882172d if discovery in recover_from_failed_open fails, don't bother to reopen 2013-04-09 15:51:04 +02:00
Sergei Golubchik
f597a6a694 HA_ERR_TABLE_DEF_CHANGED support in ha_archive 2013-04-09 15:50:55 +02:00
Sergei Golubchik
cdc01e29d3 remove dd_frm_type(), dd_frm_storage_engine(), dd_check_storage_engine_flag()
from everywhere - now RENAME, SHOW FULL TABLES, and TRUNCATE work with discovery.
improve error messages in truncate
2013-04-09 15:50:30 +02:00
Sergei Golubchik
15c936e4b3 open_table_def() no longer probes for the old pre-5.1 table file names.
SELECT * FROM `t-1` will no longer read "t-1.frm" file, use `#mysql50#t-1` for this.
2013-04-09 15:49:59 +02:00
Sergei Golubchik
9594107fb8 cleanups 2013-04-09 15:49:48 +02:00
Sergei Golubchik
5f69c8a594 ha_create_table: remove unused argument 2013-04-09 15:49:39 +02:00
Sergei Golubchik
556f568493 init_from_binary_frm_image: verify that we don't read beyond the image buffer 2013-04-09 15:49:30 +02:00
Sergei Golubchik
2481db063f move writing of the frm into init_from_binary_frm_image() 2013-04-09 15:49:21 +02:00
Sergei Golubchik
07b2523918 rename a handler method to more precisely reflect what kind of a hack it does 2013-04-09 15:49:13 +02:00
Sergei Golubchik
5d364e53cb handlerton::discover_table_names() can not discover only
"unknown" tables. Duplicates are possible - deal with them.
2013-04-09 15:49:00 +02:00
Sergei Golubchik
a489ae89b9 fix mysql_rm_table_no_locks() not to use dd_frm_type, because the frm file
may not exist (the table exists only in the engine).
2013-04-09 15:47:25 +02:00
Sergei Golubchik
e5a323e107 single table discovery: handlerton::discover_table() method.
fixes for need_full_discover_for_existence mode
2013-04-09 15:45:31 +02:00
Sergei Golubchik
f532653c29 remove ha_create_table_from_engine()
replace enum read_frm_op with a bitmap flags.
remove always-unused 'error' argument of get_table_share
2013-04-09 15:41:57 +02:00
Sergei Golubchik
6a839ff40d handlerton::discover_table_existence() method 2013-04-09 15:35:57 +02:00
Sergei Golubchik
934115184b convenience helpers for get_table_share() and tdc_open_view().
Pass db and table_name into a function instead of the table_list,
when only db and table name are needed.
2013-04-09 15:35:24 +02:00
Sergei Golubchik
b0a5dd73fa * remove ha_check_if_table_exists() and get_table_share_with_discover().
* rename check_if_table_exists() -> table_exists() and remove unneeded arguments
2013-04-09 15:35:15 +02:00
Sergei Golubchik
87a9d60ec6 revert
"
  revision-id: sanja@askmonty.org-20110511110948-4kdevwzomvk56y1w
  committer: sanja@askmonty.org
  branch nick: work-maria-5.1-CREATE-merge
  timestamp: Wed 2011-05-11 14:09:48 +0300
    Bugfix: New table creation/renaming block added if old encoded table present
"
the old behavior was less inconsistent than the new one.
In the new one the error message was sometimes different (under LOCK TABLES e.g.),
and there were race conditions (if this CREATE happened when a concurrent ALTER
has renamed the old table away but haven't put the new table in place)

The old one was like "(when using old table names) for DML #mysql50# prefix
is optional, for DDL it's required".
2013-04-09 15:35:07 +02:00
Sergei Golubchik
b9f42f4b7a rename open_binary_frm() to TABLE_SHARE::init_from_binary_frm_image()
simplify open_table_def()
2013-04-09 15:34:58 +02:00
Sergei Golubchik
474e5ecd1f Don't hold LOCK_open over open_table_def/open_binary_frm call 2013-04-09 15:34:49 +02:00
Sergei Golubchik
d71b75c90d moving LOCK_open into get_table_share() 2013-04-09 15:34:27 +02:00
Sergei Golubchik
163882665e * don't use 1-8 numbers for open_table_error codes, use an enum.
* print "table doesn't exist in engine" when a table doesn't exist in the engine,
  instead of "file not found" (if no file was involved)
* print a complete filename that cannot be found ('t1.MYI', not 't1')
* it's not an error for a DROP if a table doesn't exist in the engine (or some table
  files cannot be found) - if the DROP succeeded regardless
2013-04-09 15:34:17 +02:00
Sergei Golubchik
5ad68a0d2f don't use I_S constants for open_table_def and get_table_share,
have a specially defined enum with clearly named values
2013-04-09 15:34:09 +02:00
Sergei Golubchik
cda52b2cb2 remove dead HAVE_CRYPTED_FRM code
and now-unused read_string() function
2013-04-09 15:33:58 +02:00
Sergei Golubchik
0d1a595875 make the open_table_def to read the whole frm in memory
and let open_binary_frm to parse it from the buffer, not a file.
this avoids jumping back in forth in the frm file, and doing
intermediate buffer mallocs.
2013-04-09 15:33:49 +02:00
Sergei Golubchik
03dfb2c121 file-based table discovery for discovering storage engines
also:
* move few tests from archive/archive.test to archive/discover.test
* fix (unintentionally) bug#34104, updated result files
2013-04-09 15:31:29 +02:00
unknown
e5cbefeb89 MDEV-26, Global transaction ID.
Fix three more test failures seen in buildbot (one of them ported
from main tree).
2013-04-09 11:46:38 +02:00
unknown
80c0891588 MDEV-4326 fix.
Removed "optimization" which caused preoblems on second execution of PS with string parameter in LIMIT clause.

Fixed test_bug43560 to be able to skipp it if connection is UNIX socket.
2013-04-09 09:58:51 +03:00
Igor Babaev
1db675b6e8 Fixed mdev-4380.
Uninitialized field next_equal_field of the Field objects created
for the fields of a temporary table could hang the server.
2013-04-08 21:30:42 -07:00
Igor Babaev
ddb84f909c Fixed mdev-4378.
Uninitialized field cond_selectivity of the Field objects created
for the fields of a temporary table could cause an assertion abort.
2013-04-08 17:40:58 -07:00
Vladislav Vaintroub
5ae72bb73c MDEV-4356 : MariaDB does not start if bind-address gets resolved to more than single IP address.
MySQL bug http://bugs.mysql.com/bug.php?id=61713 was fixed in 5.5
  
Fix is to remove check for multiple entries returned by getaddrinfo(), and use the first entry that works  - i.e socket can be created.  

Unlike Oracle/MySQL's fix ,this one  is kept minimal : 
-  we do not prioritize IPv4 over IPv6,  orr other way around,  and just rely on operating system to sort getaddrinfo() entries in sensible order. There is RFC that defines  what is sensible order for getaddrinfo entries ( RFC 3484), and OS specific tweaks are also possible , like /etc/gai.conf o Linux.
-  also,  we do not force "0.0.0.0" address if bind-address is not given -  this would be a change in behavior of 5.5 at least on Windows, where passing NULL as  to getaddrinfo()  gives back IPv6-wildcard.
2013-04-07 20:32:39 +02:00
Sergei Golubchik
2a9662b401 find_files(): don't sort files in my_dir(), sort table names
after all engines have discovered their tables
  
side effect: correct alphabetical sorting as in ORDER BY ... COLLATE utf8_bin,
information_schema is no longer the first after find_files(),
tables like #mysql50#zzz are sorted first (as per table name),
not last (as per file name zzz).
2013-04-07 17:17:25 +02:00
Sergei Golubchik
8980e67693 * use Dynamic_array<> instead of List<> for the list of found tables in sql_show.cc
* make find_files static
2013-04-07 17:11:19 +02:00
Sergei Golubchik
69ba585a1e remove #if MYSQL_VERSION_ID
there is no "upstream" OQGraph version that needs to stay compatible
with different MariaDB releases.
2013-04-07 17:09:05 +02:00