Commit Graph

160 Commits

Author SHA1 Message Date
7b53f44ce3 qc_mysqlembedded: Look at all conditional items 2016-04-21 20:56:29 +03:00
d5d0547a57 MXS-680: qc_mysqlembedded does not look into functions
qc_mysqlembedded does not look into functions when collecting
the affected fields of a query. Therefore the affected fields
of a query like

    SELECT concat(a, "", "") from X where b = 1;

will be "b" and not "a b" as it should be.
2016-04-21 13:35:50 +03:00
eb1a30e9ac MXS-679: Correctly collect fields of WHERE
qc_mysqlembedded used Item::next for traversing the fields of WHERE.
That is not correct as next is not intended for that purpose:

  /**
     Intrusive list pointer for free list. If not null, points to the next
     Item on some Query_arena's free list. For instance, stored procedures
     have their own Query_arena's.

     @see Query_arena::free_list
   */
  Item *next;

In pratice this meant that the fields in the SELECT part were reported
twice and that, depending on the query, all fields of WHERE were *not*
reported. For instance, the result for

    SELECT a from X WHERE b = 1 and c = 2;

would correctly be "a b c" (in fact, it would be "a b c a"), but
the result for

    SELECT a from X WHERE b = 1 and c = 2 and d = 3;

would also be "a b c".
2016-04-21 13:35:32 +03:00
d1837e0e4a Added more error logging and fixed parsing of packets in readwritesplit
Readwritesplit tried to parse COM_PING packets which only have one byte of
payload. This would cause the queries to fail to parsed.
2016-03-04 07:55:03 +02:00
2589630b8e Unknown SQL commands are treated as writes
This will prevent any possible damage to a slave by new or unexpected commands.
2016-03-02 21:27:34 +02:00
18526c28f6 MXS-589: Separated persistent and temporary data directories
Both the passwords and temporary files of the embedded library were stored
in the same directory. Now the directories are separated and the embedded
library uses the temporary directory. The datadir cleanup also now only
cleans up the temporary data directory.
2016-02-25 11:24:20 +02:00
d3c288abf9 Remove warning when built in release mode. 2016-02-09 15:26:41 +02:00
21b415eec0 Remove MySQL arguments from qc_init.
There can be any sort of library behind qc_init. Hence the arguments
cannot be hardwired to be like the embedded library wants them.

Eventually it might make sense to allow passing arguments from
maxscale.cnf.
2016-02-01 15:53:34 +02:00
0c6e9f3def Make query_classifier a wrapper.
The query_classifier library is now only a wrapper that loads an
actual query classifier implementation. Currently it is hardwired
to load qc_mysqlembedded, which implements the query classifier
API using MySQL embedded.

This will be changed, so that the library to load is specified
when qc_init() is called. That will then allow the query classifier
to be specified in the config file.

Currently there seems to be a conflict between the mysql_library_end()
call made in qc_mysqlembedded and the mysql_library_end() call made in
gateway.c. The reason is that they both finalize a shared library.
For the time being mysql_library_end() is not called in gateway.c.
This problem is likely to go away by switching from the client
library to the connector-c library.
2016-02-01 15:43:05 +02:00
5e8ba4b519 Introduce MySQL-embedded based query classifier plugin.
Currently not used, but the existing query_classifier will be
changed into being just a wrapper around a dynamically loaded
query classifier plugin, i.e. qc_mysqlembedded.
2016-01-28 08:26:32 +02:00