59 Commits

Author SHA1 Message Date
Markus Mäkelä
5a9e84d39a
Merge branch '2.3' into develop 2018-12-18 00:00:00 +02:00
Markus Mäkelä
35d31801bb
Merge branch '2.2' into 2.3 2018-12-17 23:52:56 +02:00
Markus Mäkelä
a40e2f94f3
Fix file descriptor assertions
Zero is a valid file descriptor and no negative values other than -1 are
ever stored in the DCB::fd member.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
20fe9b9dca
MXS-2196: Rename session states
Minor renaming of the session state enum values. Also exposed the session
state stringification function in the public header and removed the
stringification macro.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
7aaadfc550
MXS-2196: Fix dcb error flag assignment
The error flag was set before the function was called which caused the
function to never be used. As the core should handle the filtering of
multiple errors on the same DCB, the protocol modules should not check it.
2018-12-13 13:27:45 +02:00
Markus Mäkelä
8b00a00ea7 MXS-2216: Use correct function in response processing
When a response to a prepared statement was processed, the number of EOF
packets was used to see whether the response was complete. This code used
a function that does not work with the special packet returned by a PS
preparation that is similar to an OK packet.

The correct method is to count the total number of packets in the
response.
2018-12-11 13:54:10 +02:00
Esa Korhonen
e979a73cc0 Remove the STRSRVSTATUS macro
Use server_status() instead.
2018-12-10 15:55:07 +02:00
Johan Wikman
c0c9a9858d MXS-2197 Rename maxscale/log.h to maxscale/log.hh
In files either include maxscale/log.hh or remove include entirelly
as maxscale/ccdefs.hh includes it.
2018-12-10 12:58:17 +02:00
Markus Mäkelä
77477d9648
MXS-2196: Rename dcb_role_t to DCB::Role 2018-12-05 15:30:44 +02:00
Esa Korhonen
9f721f725e MXS-2205 Convert maxscale/protocol/mysql.h to .hh 2018-12-05 11:12:20 +02:00
Esa Korhonen
d96a7dedc5 MXS-2205 Convert maxscale/poll.h to .hh 2018-12-04 14:51:02 +02:00
Markus Mäkelä
692127a2cb
MXS-2196: Remove the dummy session
As each connection now immediately gets a session the dummy session is no
longer required. The next step would be to combine parts of the session
and the client DCB into one entity. This would prevent the possibility of
a client DCB with no associated session. Backend DCBs are different as
they can move from one session to another when the persistent connection
pool is in use.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
7a87ff9ce1
MXS-2196: Remove redundant DCB member variables
The variables held duplicate information already present in other parts of
the system.
2018-12-04 11:50:43 +02:00
Markus Mäkelä
a6063b5e85
MXS-2196: Remove listen entry point from protocol
The entry point was useless as all of the modules called the same
function.
2018-12-04 11:39:52 +02:00
Esa Korhonen
756593a718 MXS-2205 Combine maxscale/router.h with maxscale/router.hh 2018-12-03 15:28:06 +02:00
Esa Korhonen
97bb7e7e1a MXS-2205 Combine maxscale/modutil.h with maxscale/modutil.hh 2018-12-03 15:28:06 +02:00
Markus Mäkelä
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
Markus Mäkelä
e5a0b4e9bb
Merge branch '2.2' into develop 2018-09-21 14:18:15 +03:00
Markus Mäkelä
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
Markus Mäkelä
71ffef5708
Partially revert 4ba011266843857bbd3201e5b925a47e88e1808f
Add back leading operator enforcement.
2018-09-20 15:57:30 +03:00
Markus Mäkelä
7ec2f77708
Merge branch '2.2' into develop 2018-09-12 23:18:08 +03:00
Markus Mäkelä
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
Esa Korhonen
fd176c4122 Merge branch '2.2' into develop 2018-09-11 12:57:19 +03:00
dapeng huang
087272c3e4 fix multistatment hang (#180) 2018-09-11 08:39:12 +03:00
Markus Mäkelä
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
Niclas Antti
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
Johan Wikman
3f53eddbde MXS-2020 Replace ss[_info]_dassert with mxb_assert[_message] 2018-08-22 11:34:59 +03:00
Johan Wikman
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
Johan Wikman
ae43e4f0f2 MXS-2013 Remove all CHK_-macros 2018-08-15 09:28:04 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
cc0299aee6 Update change date of 2.3 2018-06-25 10:07:52 +03:00
Markus Mäkelä
a812e02ba4
Merge branch '2.2' into develop 2018-06-15 10:48:07 +03:00
Markus Mäkelä
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
Esa Korhonen
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
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
7e9062f20f Merge branch '2.2' into develop 2018-05-16 09:31:13 +03:00
Markus Mäkelä
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
Markus Mäkelä
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
Johan Wikman
7876c3c70f MXS-1835 Turn all protocol modules into C++ 2018-05-02 09:54:37 +03:00
Markus Mäkelä
490d8c0963
Merge branch '2.2' into develop 2018-04-30 12:38:19 +03:00
Markus Mäkelä
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
Esa Korhonen
5d010ff712 Cleanup SERVER struct
Removed one unused field. Rearranged others, clarified comments.
2018-04-27 10:48:56 +03: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ä
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ä
9f5d2244ea
Merge branch '2.2' into develop 2018-03-14 14:30:50 +02:00
Markus Mäkelä
d7c1d76065
Merge branch '2.1' into 2.2 2018-03-14 14:29:56 +02:00