Commit graph

36 commits

Author SHA1 Message Date
holyfoot/hf@mysql.com/hfmain.(none)
3f51ff6403 Bug #32374 crash with filesort when selecting from federated table and view.
filesort() uses file->estimate_rows_upper_bound() call to allocate
internal buffers. If this function returns a value smaller than
a number of row that will be returned later in find_all_keys(),
that can cause server crash.
Fixed by implementing ha_federated::estimate_rows_upper_bound() to
return maximum possible number of rows.
Present estimation for FEDERATED always returns 0 if the linked to the VIEW.
2007-11-30 17:08:00 +04:00
tsmith@ramayana.hindu.god
8575227571 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-08-01 18:14:50 -06:00
acurtis/antony@xiphis.org/ltamd64.xiphis.org
fbcd70a494 Bug#25679
"Federated Denial of Service"
  Federated storage engine used to attempt to open connections within
  the ::create() and ::open() methods which are invoked while LOCK_open
  mutex is being held by mysqld. As a result, no other client sessions
  can open tables while Federated is attempting to open a connection.
  Long DNS lookup times would stall mysqld's operation and a rogue
  connection string which connects to a remote server which simply
  stalls during handshake can stall mysqld for a much longer period of
  time.
  This patch moves the opening of the connection much later, when the
  federated actually issues queries, by which time the LOCK_open mutex is
  no longer being held.
2007-07-25 12:23:24 -07:00
cmiller@zippy.cornsilk.net
773861ded7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-07-19 15:33:27 -04:00
cmiller@zippy.cornsilk.net
832fd24c41 Bug#26909: Specified key was too long; max key length is 255 bytes \
when creating table

Federated tables had an artificially low maximum of key length, 
because the handler failed to implement a method to return it and 
the default value is taked from the prototype handler.

Now, implement that method and return the maximum possible key
length, which is that of InnoDB.
2007-07-18 14:03:58 -04:00
antony@ppcg5.local
fc241de333 Bug#25513
"Federared Transactions Failure"
  Bug occurs when the user performs an operation which inserts more than 
  one row into the federated table and the federated table references a 
  remote table stored within a transactional storage engine. When the
  insert operation for any one row in the statement fails due to 
  constraint violation, the federated engine is unable to perform 
  statement rollback and so the remote table contains a partial commit. 
  The user would expect a statement to perform the same so a statement 
  rollback is expected.
  This bug was fixed by implementing  bulk-insert handling into the
  federated storage engine. This will relieve the bug for most common
  situations by enabling the generation of a multi-row insert into the
  remote table and thus permitting the remote table to perform 
  statement rollback when neccessary.
  The multi-row insert is limited to the maximum packet size between 
  servers and should the size overflow, more than one insert statement 
  will be sent and this bug will reappear. Multi-row insert is disabled
  when an "INSERT...ON DUPLICATE KEY UPDATE" is being performed.
  The bulk-insert handling will offer a significant performance boost 
  when inserting a large number of small rows.
This patch builds on Bug29019 and Bug25511
2007-06-28 16:03:01 -07:00
antony@ppcg5.local
b0b0b0fbc4 Bug#25511
"Federated INSERT failures"
  Federated does not correctly handle "INSERT...ON DUPLICATE KEY UPDATE"
  However, implementing such support is not reasonably possible without
  increasing complexity of the storage engine: checking that constraints
  on remote server match local server and parsing error messages.
  This patch causes 'ON DUPLICATE KEY' to fail with ER_DUP_KEY message
  if a conflict occurs and not to fail silently.
2007-06-28 13:36:26 -07:00
antony@ppcg5.local
b3e29fbd1d Bug#29019
"REPLACE/INSERT IGNORE/UPDATE IGNORE doesn't work"
  Federated does not record neccessary HA_EXTRA flags in order to
  support REPLACE/INSERT IGNORE/UPDATE IGNORE.
  Implement ::extra() to capture flags neccessary for functionality.
New function append_ident() to better escape identifiers consistantly.
2007-06-28 00:23:14 -07:00
kent@mysql.com/kent-amd64.(none)
226a5c833f Many files:
Changed header to GPL version 2 only
2006-12-23 20:17:15 +01:00
monty@mysql.com/nosik.monty.fi
e825879800 Remove compiler warnings
(Mostly in DBUG_PRINT() and unused arguments)
Fixed bug in query cache when used with traceing (--with-debug)
Fixed memory leak in mysqldump
Removed warnings from mysqltest scripts (replaced -- with #)
2006-11-20 22:42:06 +02:00
stewart@willster.(none)
fff4559edd BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables
update federated for fix
2006-10-16 17:41:29 +10:00
pgalbraith/patg@buffy.netfrastructure.com
cf8b64a114 BUG #15133 "unique index with nullable value not accepted in federated table"
Added HA_NULL_IN_KEY to table flags to allow for nullable unique indexes
and added test to verify

ha_federated.h:
  BUG #15133 "unique index with nullable value not accepted in federated table"
  added HA_NULL_IN_KEY to table flags to allow for nullable unique indexes
federated.test:
  BUG #15133 "unique index with nullable value not accepted in federated table"
  New test to show that nullable unique indexes work
federated.result:
  BUG #15133 "unique index with nullable value not accepted in federated table"
  New results for new test
2006-07-25 18:38:09 -04:00
patg@govinda.patg.net
18d264a1ea BUG #19773
Pushbuild fixes to result file, test, and header file for federated.
2006-06-28 12:18:21 -07:00
patg@govinda.patg.net
d2df283b78 BUG #19773
Final-review fixes per Monty, pre-push. OK'd for 
push. Please see each file's comments.
2006-06-27 23:49:48 -07:00
msvensson@devsrv-b.mysql.com
f2444c50fc Bug#17377 Federated Engine returns wrong Data, always the rows with the highest ID
- Always make rnd_pos reposition the cursor in the fetched result set.
2006-02-28 11:17:40 +01:00
patg@govinda.patg.net
15ec4431bc BUG# 14768
Added fixes to make last_insert_id() to work.
2006-01-27 15:43:44 -08:00
eric@mysql.com
ef06401549 Improvement to federated for BUG#12659
Now many direct references to my_error() have been removed.
2005-09-13 23:31:17 -07:00
brian@zim.(none)
ffcc4ae4b1 This patch disables the query cache for the federated engine. 2005-09-04 11:25:13 -07:00
konstantin@mysql.com
14344b658a A fix and a test case for Bug#10760 and complementary cleanups.
The idea of the patch
is that every cursor gets its own lock id for table level locking.
Thus cursors are protected from updates performed within the same 
connection. Additionally a list of transient (must be closed at
commit) cursors is maintained and all transient cursors are closed
when necessary. Lastly, this patch adds support for deadlock
timeouts to TLL locking when using cursors.
+ post-review fixes.
2005-07-19 22:21:12 +04:00
patg@radha.local
e2d8644053 Eric's implentation of OPTIMIZE TABLE and REPAIR TABLE,
as well as changes to the test.
2005-07-19 03:04:51 +02:00
patg@radha.local
dd129ed329 Federated Storage Engine, bug 9925 "Federated query processor (step 2 or step 3) not using logic in
WHERE statement"
2005-07-17 04:10:19 +02:00
patg@krsna.patg.net
db1fb6a7e5 This is the same patch as 1.1937, with small variable declaration changes, memory
deallocation cleanup
2005-07-15 17:33:47 -07:00
konstantin@mysql.com
c2f7e4d610 Fix broken linking when building with ha_federated 2005-06-05 23:00:45 +04:00
konstantin@mysql.com
9ca989aff2 Chmod -x for ha_federated.h 2005-03-05 00:35:00 +03:00
patg@krsna.patg.net
4b7bc748ea WL #2094 Federated Storage Handler
This is the first changeset of suggested changes recommended in Kostja's 
review of my patch, 1.1846, which includes only functionality changes. 
Style changes/Documentation patch to follow.
2005-02-23 00:29:57 -08:00
patg@krsna.patg.net
e6352ee568 Merge 2005-02-20 14:20:05 -08:00
patg@krsna.patg.net
c33868e70c WL# 2094, Federated Storage Handler. This patch fixes bug #8599, HPUX compile errors.
Testing on hp3750 shows these fixes fix the compile problems on HPUX, but I have 
a problem where when I run the tests, the test shows that the tables default to MyISAM!
2005-02-19 10:45:19 -08:00
serg@serg.mylan
262dd182ef compilation fixes 2005-02-18 14:42:14 +01:00
patg@krsna.patg.net
de2fea12c3 WL# 2094, This patch is on top of 1.1814, 1.1846, 1.1856, which contain fixes
for bugs 8033, 8065, 8535, 8582

This particular changeset contains style changes per code review suggestions 
and does not contain bug fixes in of itself.

ha_federated.h:
  standardised code style to conform to internals.texi
ha_federated.cc:
  more code standardisation to conform to internals.texi.
  - casts
  - declarations
  - comments
  - 80 char width
  also, append using string1.append(string2) and not 
  string1.append(string2.c_ptr_quick())
2005-02-17 16:17:21 -08:00
patg@krsna.patg.net
005deef102 WL# 2094 Federated Storage Handler
This changeset/patch is on top of changesets 1.1814 and 1.1846 
(for bugs 8033 and 8065) and now fixes bug 8535.

These changes have been built and tested successfully on build.mysql.com

handler.cc:
  Added hooks for federated_db_init() and federated_db_end(), 
  as done with ha_archive_db does, per suggestion by Ingo in
  code review of patch 1.1846.
ha_federated.h:
  declaration of federated_db_init() and federated_db_end()
ha_federated.cc:
  - Fixed some indentation problems from indent-ex (mainly to do with
    cases where "variablename += value"
  - Added federated_db_init() and federated_db_end(), as done with
    archive, which also handler more elegantly one of the memory leaks
    from bug 8033 where the federated_mutex was not freed
  - Removed extrenous debug messages in parse_url()
  - Fixed bug 8535, caused by NULL being quoted in write_row. This used to
    work (incorrectly) but a recent change was made in the server that 
    exposed this
2005-02-16 23:07:10 -08:00
patg@krsna.patg.net
0a48c5b5c2 WL# 2094
This patch contains all that my previous patch (1.1814) contained, with the addition of using cli_fetch_lengths for
handling binary data (Bar noted this on the review of 1.1814, Guilhem suggested using cli_fetch_lenghts by 
making available via removal of static in method definition and declaration in mysql.h, but
Konstantin had some reservations, but he said to commit the patch using this anyway,
and I suppose this can be discussed. I abandoned 1.1814 because Monty made a couple
fixes to my code as well as formatting changes, and I thought it would just be easier
to hand-edit my changes into a fresh clone and then make a patch. 

The reason for using cli_fetch_lengths is so that I can correctly get the length of
the field I am setting into the field. I was previously using 'strlen' but Bar pointed out this
won't correctly get the length of binary data and is also less effecient. Upon testing,
it was in fact verified that binary data in a blob table was being inserted correctly,
but not being retrieved correctly, all due to not having the correct value for the
field:

(*field)->store(row[x], strlen(row[x]), &my_charset_bin);

was changed to:

(*field)->store(row[x], lengths[x], &my_charset_bin);

lengths being a unsigned long pointer to the values of the field lengths from a 
MYSQL_ROW.

Since the server doesn't have the function "mysql_fetch_lengths" available, I tried 
to use "result->lengths", but this isn't set, so I finally successfully used 
cli_fetch_lenghts, which does give the correct lengths, and now the binary data gets
retrieved correctly.

I've also run the code through indent-ex and am using Brian's vimrc to ensure correct formatting!

This code passes the entire test suite, without any errors or warning on both my 
workstation and build.mysql.com
2005-02-06 09:40:07 -08:00
patg@patrick-galbraiths-computer.local
097bc9294c changes to get rid of compile warnings in both ha_federated.cc and ha_federated.h 2005-01-26 11:47:28 -08:00
patg@pc248.lfp.kcls.org
1da60b9f45 -Added quote_data and needs_quotes (moved from federated handler.
-New tests and results

logging_ok:
  Logging to logging@openlogging.org accepted
ha_federated.h:
  removed quote_data and type_quote (now in the Field class)
ha_federated.cc:
  moved quote_data and type_quote to field class
field.h:
  new methods quote_data and needs_quotes declared
field.cc:
  new field class methods quote_data and needs_quotes (per Monty's request)
federated.test:
  more tests, joins, index tests
have_federated_db.require:
  new name of federated system var
federated.result:
  new test results for federated handler
have_federated_db.inc:
  changed name of variable in test due to change in vars
sql_analyse.cc:
  over-ridden append_escaped to take (String *, char *, uint) per requirements of 'create_where_from_key' method in federated handler.
mysql_priv.h:
  define over-ridden append_escaped to take arguments from 'create_where_from_key' method in federated handler 
ha_federated.cc:
  implemented "create_where_from_key" to deal properly with two-byte prefix and multi keys. Initial testing shows it works, but I still need to move quoting to field class and also look at changes per Segei's suggestions.
2005-01-20 18:36:40 -08:00
patg@patrick-galbraiths-computer.local
7c51cce029 progress in fixing multi-key, two-byte prefix keys. 2005-01-13 18:21:54 -08:00
patg@patrick-galbraiths-computer.local
dac98f9b45 WL# 2094 Federated Storage Handler, added fixes per suggestions by Bar and Antony 2004-12-16 19:08:32 -08:00
patg@patrick-galbraiths-computer.local
301c493252 First commit to mysql-5.0 tree to include MySQL Federated Storage Handler. This includes both the source and header files, test (results, test, require), and modifications to server and handler base files, and autoconf modifications to properly build federated handler. 2004-12-11 12:03:51 -08:00