9959 Commits

Author SHA1 Message Date
Johan Wikman
296bac45c1 Merge branch '2.2' into develop 2018-03-21 15:18:11 +02:00
Markus Mäkelä
9c6e15b426 MXS-1719: Fix hang on multi-statement UPDATE
When a multi-statement query consisting completely of UPDATE statements is
received, the packets can be received in two separate buffers. To cope
with this situation, the state change into REPLY_STATE_RSET_COLDEF must
only be done if the buffer contains more than a single packet.
2018-03-21 14:58:09 +02:00
Markus Mäkelä
03310fa981 Add missing .cpp suffix
It doesn't appear to be necessary but other files use it.
2018-03-21 14:58:09 +02:00
Markus Mäkelä
433528aa59 MXS-1731: Treat empty parameters as errors
If a parameter is defined without a value, it is now treated as an error.
2018-03-21 14:58:09 +02:00
Markus Mäkelä
436c563da7 MXS-1729: Allow global routeQuery to return values
The `lua_pcall` parameters were incorrect, the second number signifies the
number of parameters the function can return.
2018-03-21 14:58:09 +02:00
Johan Wikman
552c33e14d MXS-1719 Add test that reveals problem
With the masking filter, several UPDATEs as one multi-statement
causes the session to hang.
2018-03-21 14:58:09 +02:00
Johan Wikman
8e522757cf Update version to 2.2.4 2018-03-21 14:58:09 +02:00
Johan Wikman
5d54267d19 MXS-1730 Add change that fixes the problem
ENGINE is a keyword but not a reserved word, so it must
silently convert into an identifier if it is used in a
context where it cannot be used as a keyword.
2018-03-21 14:58:09 +02:00
Johan Wikman
9208d3a70c MXS-1730 Add test-case that reveals the problem 2018-03-21 14:57:35 +02:00
Johan Wikman
f253f2e6dc Update version to 2.1.16 2018-03-21 14:56:53 +02:00
Johan Wikman
0e3874781f Fix merge breakage 2018-03-21 14:20:54 +02:00
Markus Mäkelä
61b93185c5
Remove useless session spinlock
The session level spinlock was useless given the threading model changes
done for 2.1.
2018-03-21 14:15:13 +02:00
Markus Mäkelä
8a397f574f
Expose modutil_get_canonical in luafilter
Exposing the canonicalization code in the luafilter allows it to be used
on the Lua side of things. This should enable some pretty cool stuff to be
done with it.
2018-03-21 14:15:13 +02:00
Markus Mäkelä
092286297e
MXS-1719: Fix hang on multi-statement UPDATE
When a multi-statement query consisting completely of UPDATE statements is
received, the packets can be received in two separate buffers. To cope
with this situation, the state change into REPLY_STATE_RSET_COLDEF must
only be done if the buffer contains more than a single packet.
2018-03-21 14:14:16 +02:00
Markus Mäkelä
42412149bd
Add missing .cpp suffix
It doesn't appear to be necessary but other files use it.
2018-03-21 14:14:14 +02:00
Markus Mäkelä
8b943e249b
MXS-1731: Treat empty parameters as errors
If a parameter is defined without a value, it is now treated as an error.
2018-03-21 14:14:13 +02:00
Markus Mäkelä
7359774ae1
MXS-1729: Allow global routeQuery to return values
The `lua_pcall` parameters were incorrect, the second number signifies the
number of parameters the function can return.
2018-03-21 14:14:04 +02:00
Johan Wikman
f5562d2cab MXS-1719 Add test that reveals problem
With the masking filter, several UPDATEs as one multi-statement
causes the session to hang.
2018-03-21 13:39:03 +02:00
Johan Wikman
c4d3628c4a Update version to 2.2.4 2018-03-21 13:32:36 +02:00
Johan Wikman
a996ea58ef Merge branch '2.1' into 2.2 2018-03-21 13:27:51 +02:00
Johan Wikman
041b775150 MXS-1730 Add change that fixes the problem
ENGINE is a keyword but not a reserved word, so it must
silently convert into an identifier if it is used in a
context where it cannot be used as a keyword.
2018-03-21 13:25:06 +02:00
Johan Wikman
5be9a8d7f8 MXS-1730 Add test-case that reveals the problem 2018-03-21 13:25:06 +02:00
Johan Wikman
4413c0cec0 Update version to 2.1.16 2018-03-21 13:23:44 +02:00
Johan Wikman
db9dc2d2d5 Merge branch '2.2' into develop 2018-03-21 11:25:08 +02:00
Johan Wikman
2cc0c5f1aa Merge branch '2.1' into 2.2 2018-03-21 11:24:41 +02:00
Johan Wikman
cb3a6a0e11 Merge branch '2.1.15' into 2.1 2018-03-21 11:23:28 +02:00
Johan Wikman
dadfb68a70 Update 2.1.15 release date. 2018-03-21 11:17:58 +02:00
Esa Korhonen
5112cb4cfc MXS-1703: Stop monitor before reading class data
In theory, the value of m_master could change between reading it to
local variable and stopping monitor. To be on the safe side, stop the
monitor first.
2018-03-20 15:46:06 +02:00
Esa Korhonen
09a22b26c8 MXS-1703 Fix uninitialized pointer in manual switchover
If the current master was given by user, maxscale would crash.
2018-03-20 14:30:15 +02:00
Markus Mäkelä
e4efc29297
MXS-1702: Process comments when canonicalizing
The canonicalization process now strips non-executable comments from the
SQL and replaces all constants in executable comments.

Enabled the comment test and updated expected output of the select and
alter tests.
2018-03-20 13:53:55 +02:00
Markus Mäkelä
9fe25c8003
MXS-1702: Update tests
Updated tests with new expected output. Also took new function into use
and removed the old one.

Since the comment removal isn't added yet, one of the tests is expected to
fail and it is temporarily disabled.
2018-03-20 13:53:55 +02:00
Markus Mäkelä
a627e342f3
MXS-1702: Fix minor canonicalization bugs
Allow hexadecimal digits if a 0x prefix has been seen. Squash repeating
whitespace and remove quotes from quoted strings.
2018-03-20 13:53:55 +02:00
Markus Mäkelä
8d3f02b8a4
MXS-1702: Canonicalize negative numbers
The new canonicalization function now processes negative numbers
correctly. It uses a look-behind operation to detect whether the operation
is a negation of a number or a subtraction from another value.
2018-03-20 13:53:55 +02:00
Markus Mäkelä
75fadd711a
MXS-1702: Add new canonicalization function
The function uses a hand-written parser that picks out the values and
replaces them with question marks. This function is not yet able to
process negative values; a `-?` token will be generated for all negative
numbers.

The new function will canonicalize the query in such a way that string and
number constants cannot be distinguished which means that it won't pass
the current test cases.
2018-03-20 13:53:55 +02:00
Markus Mäkelä
a03e8d46f0
MXS-1702: Rename tests
The test naming now follows the common convention.
2018-03-20 13:53:55 +02:00
Markus Mäkelä
e90c29cce2
MXS-1702: Clean up and convert test to C++
Cleaned up and updated the test; the code was written with a pre-C99
standard in mind.

Added a get() method into mxs::Buffer to make it easier to use with
non-C++ functions.
2018-03-20 13:53:54 +02:00
Markus Mäkelä
cb170eb88e
MXS-1702: Move canonicalization test into core
Moved the test into the core where it belongs.
2018-03-20 13:53:54 +02:00
Markus Mäkelä
3e0b3db65e
MXS-359: Fix master_failure_mode=fail_instantly
The connection was not closed when master_failure_mode=fail_instantly was
used. This caused rwsplit_readonly to fail.
2018-03-20 13:42:25 +02:00
Markus Mäkelä
0fde6e501d
Don't treat EINTR as an error
When the epoll_wait call returns with an error and errno is set to EINTR,
no warning should be logged as this is correct behavior.
2018-03-20 13:42:25 +02:00
Markus Mäkelä
e45759d35d
Skip scanning of OK packets if preparing statement
The OK packet that a COM_STMT_PREPARE returns is not a normal OK packet
and need to be skipped as the packet layout is different.
2018-03-20 13:42:25 +02:00
Markus Mäkelä
10a9d70851
Get service capabilities from a better source
The DCB pointer in the MySQLProtocol struct doesn't appear to be updated
in all cases which causes it to be an unreliable source. As the session
itself is always available and it always has the service pointer properly
set, it should be used instead.

Also removed the dead protocol compression code and replaced the
parameters with the service capability bits.
2018-03-20 13:42:25 +02:00
Markus Mäkelä
20c5ca1619
Make session state change tracking conditional
By making it conditional, we prevent the problems that arise when the
replication protocol is used in combination with the session state change
tracking. In addition to this, it prevents unnecessary work for routers
and filters that don't need it.
2018-03-20 13:42:24 +02:00
Markus Mäkelä
f525822472
Merge branch '2.2' into develop 2018-03-20 13:14:54 +02:00
Markus Mäkelä
04ca9658c5
Use correct executable name
The test executable name had a typo in it.
2018-03-20 13:11:52 +02:00
Johan Wikman
ad05019445 Avoid clashes with TRUE/FALSE
TRUE/FALSE may be visible as defines. Consequently better
not to use them as names.
2018-03-20 13:10:31 +02:00
Markus Mäkelä
0b89bc167a
Correct listener port and socket documentation
Remove the old paragraph and added a note about defining separate
listeners for UNIX domain sockets and network ports.

Also fixed the example listener definition.
2018-03-20 13:07:28 +02:00
Markus Mäkelä
39dff20a0a
Use correct callback function in MySQLAuth
The JSON diagnostics function used the non-JSON version of the callback.
2018-03-20 13:07:27 +02:00
Markus Mäkelä
dcf9d7f152
Fix calls to diagnostics_json
Add missing listener JSON diagnostics call. Check that the
diagnostics_json function exists before calling it.

As the protocol modules don't have diagnostics functions, they aren't
called.

Replace hard-coded strings with constant parameters. This makes it
slightly cleaner.
2018-03-20 13:07:27 +02:00
Markus Mäkelä
94f29a11c5
MXS-1724: Reimplement core dump detection
Reimplemented the core dump detection for 2.2.
2018-03-20 13:06:20 +02:00
Markus Mäkelä
b0e0a79b46
Merge branch '2.1' into 2.2 2018-03-20 12:38:23 +02:00