Commit Graph

43 Commits

Author SHA1 Message Date
81937c635b Fix current command tracking during LDLI
When a LOAD DATA LOCAL INFILE was executed, the client and backend
protocols would update the command byte leading to misinterpretations of
the data.
2018-11-27 12:52:44 +02:00
e5a0b4e9bb Merge branch '2.2' into develop 2018-09-21 14:18:15 +03:00
d55c07dc2e MXS-2066: Reset resultset collection by default
The collection of resultsets needs to be disabled by default when a
response is received to cover the cases where an error is returned.

The collection of results should also not be set for queries that do not
generate any responses.
2018-09-21 11:14:45 +03:00
71ffef5708 Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
7ec2f77708 Merge branch '2.2' into develop 2018-09-12 23:18:08 +03:00
d7b7f43efb Rename misleading function
The expecting resultset function does not expect a resultset but a text
protocol result.
2018-09-12 08:44:31 +03:00
fd176c4122 Merge branch '2.2' into develop 2018-09-11 12:57:19 +03:00
087272c3e4 fix multistatment hang (#180) 2018-09-11 08:39:12 +03:00
d11c78ad80 Format all sources with Uncrustify
Formatted all sources and manually tuned some files to make the code look
neater.
2018-09-10 13:22:49 +03:00
c447e5cf15 Uncrustify maxscale
See script directory for method. The script to run in the top level
MaxScale directory is called maxscale-uncrustify.sh, which uses
another script, list-src, from the same directory (so you need to set
your PATH). The uncrustify version was 0.66.
2018-09-09 22:26:19 +03:00
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
cf0aeed516 MXS-2014 Rename log_manager.h to log.h
There's nothing resembling a manager anymore.
2018-08-17 10:59:37 +03:00
ae43e4f0f2 MXS-2013 Remove all CHK_-macros 2018-08-15 09:28:04 +03:00
4da7e4678f Improve protocol level result collection
The result collection now covers more cases, including the use of
COM_CHANGE_USER. The addition of COM_STMT_EXECUTE to the list of commands
that generate result set responses is needed in order for the code to take
the correct branch.
2018-07-17 11:52:23 +03:00
28609a2c77 Remove session command processing from mariadbbackend
With the removal of the old session command implementation, the code that
used it can be removed or replaced with newer constructs. As a result, the
backend protocol no longer does any session command processing.

The three buffer types, GWBUF_TYPE_SESCMD_RESPONSE,
GWBUF_TYPE_RESPONSE_END and GWBUF_TYPE_SESCMD as well as their related
macros are no longer used and can be removed.
2018-07-17 11:52:22 +03:00
19feee9e0e Remove old session command implementation
The old implementation was largely. Also removed some unused macros from
the header.
2018-07-17 11:52:22 +03:00
9b1d1303ce MXS-1977: Archive session command on completion
The legacy session command implementation is still partially used and a
cleanup call was missing. This should be removed in the next major
release.
2018-07-15 21:17:39 +03:00
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
a812e02ba4 Merge branch '2.2' into develop 2018-06-15 10:48:07 +03:00
3d1c2b421a MXS-1921: Explain why session was closed
When a client connection is closed by MaxScale before the client initiates
a controlled closing of the connection, an error message is sent. This
error message now also explains why the connection was closed to make
problem resolution easier.
2018-06-14 13:48:07 +03:00
c039821467 MXS-1883 Maintenance is now the only user-modifiable bit for a monitored server
The request to turn maintenance off/on is a separate flag, although the actual
status is still contained in the status bitfield.
2018-05-30 10:09:15 +03:00
3f4d6391b5 MXS-553: Add diagnostics_json to protocol API
The protocol now allows protocol modules to return JSON formatted
information about the protocol module internals. Currently this is only
implemented by the mariadbbackend module and it returns the current
connection ID on the backend server.
2018-05-22 17:46:25 +03:00
cdb43335a2 MXS-553: Update and document the protocol API
Removed unused and properly documented all entry points in the protocol
module API. As the removal of the `session` entry point is an backwards
incompatible change, the protocol API version was updated.
2018-05-22 17:46:25 +03:00
7e9062f20f Merge branch '2.2' into develop 2018-05-16 09:31:13 +03:00
00581e7f35 MXS-1826: Fix COM_CHANGE_USER regression
The re-authentication done in MaxScale caused multiple error packets to be
sent for the same COM_CHANGE_USER. In addition to this, the failure of
authentication did not terminate the client connection.

The change in behavior requires the test case to be changed as well.
2018-05-15 10:14:38 +03:00
d6c44aaf52 MXS-1804: Allow large session commands
Session commands that span multiple packets are now allowed and will
work. However, if one is executed the session command history is disabled
as no interface for appending to session commands exists.

The backend protocol modules now also correctly track the current
command. This was a pre-requisite for large session commands as they
needed to be gathered into a single buffer and to do this the current
command had to be accurate.

Updated tests to expect success instead of failure for large prepared
statements.
2018-05-03 09:46:47 +03:00
7876c3c70f MXS-1835 Turn all protocol modules into C++ 2018-05-02 09:54:37 +03:00
490d8c0963 Merge branch '2.2' into develop 2018-04-30 12:38:19 +03:00
452f2190ae MXS-1826: Handle Authswitch packet for COM_CHANGE_USER
If the server responds with a COM_CHANGE_USER to the default
authentication plugin, the backend protocol will answer correctly.
2018-04-29 10:42:12 +03:00
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +03:00
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
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
9f5d2244ea Merge branch '2.2' into develop 2018-03-14 14:30:50 +02:00
d7c1d76065 Merge branch '2.1' into 2.2 2018-03-14 14:29:56 +02:00
2023ee4dc7 MXS-1713: Fix resultset collection code
The resultset collection was not detected early enough in the code which
caused partial results to be returned to the router.
2018-03-14 13:02:47 +02:00
771716e9db Merge branch '2.2' into develop 2018-02-05 10:22:43 +02:00
9f0a691233 Always stop the session by closing the client DCB
By always starting the session shutdown process by stopping the client
DCB, the manipulation of the session state can be removed from the backend
protocol modules and replaced with a fake hangup event.

Delivering this event via the core allows the actual dcb_close call on the
client DCB to be done only when the client DCB is being handled by a
worker.
2018-02-02 12:28:07 +02:00
ebf0d6fc5f Close client DCB with a hangup in the backend protocol
Directly closing the client DCB in the backend protocol modules is not
correct anymore as the state of the session doesn't change when the client
DCB is closed. By propagating the shutdown of the session with a fake
hangup to the client DCB, the closing of the DCB is done only once.

Added debug assertions that make sure all DCBs are closed only
once. Removed redundant code in the backend protocol error handling code.
2018-02-02 12:28:07 +02:00
81f303512e check protocol state to determine real ok packet 2018-01-22 14:52:12 +08:00
a52e1ac8d7 add session tracker:SESSION_TRACK_TRANSACTION_CHARACTERISTICS and fix wrong state mapping 2018-01-16 13:56:00 +08:00
d234b13027 refactor, check every packet before parser ok packet, move config to service, fix code style, ... 2018-01-15 20:25:44 +08:00
e1aeac8b07 get session transation state from backend via session track mechanism 2018-01-14 12:23:38 +08:00
afaf890840 MXS-1596 Rename mysqlbackend to mariadbbackend 2018-01-05 10:01:50 +02:00