9919 Commits

Author SHA1 Message Date
Johan Wikman
8c9aa82a69 Merge branch '2.1' into 2.2 2018-05-02 10:40:24 +03:00
Johan Wikman
b8bba93f08 MXS-1839 Do not leak memory from maxinfo "show sessions"
When there is nothing more to show, the resultset user data
must be freed.
2018-05-02 10:37:03 +03:00
Johan Wikman
3d8c447b3a MXS-1836 Do not store pointer to data on the stack
First the resultset objects is created, then then the iteration
is done. Consequently, the user data cannot refer to anything
on the stack.
2018-05-02 10:23:07 +03:00
Markus Mäkelä
1e700ab9ba
MXS-1832: Return 1 on failure
If MaxScale responds with an error, MaxCtrl now returns 1.
2018-04-30 09:46:26 +03:00
Markus Mäkelä
cca39b910d
MXS-1837: Fix typo in REST API documentation
The documentation now has correct resource definitions for stopping and
starting services.
2018-04-30 06:27:04 +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
Markus Mäkelä
34aefa55c8
Remove write permissions on scripts
Accidental modifications of scripts/programs are more likely if the owner
has write permissions on the file. In addition, they are not required and
thus can be removed.
2018-04-27 18:15:19 +03:00
Markus Mäkelä
cfa599aea8
MXS-1833: Force all maxinfo traffic to the main thread
The same problem that caused maxadmin to lock up was also what caused
maxinfo to lock up. The concurrent access to the legacy administrative
functions caused deadlocks.
2018-04-27 12:38:43 +03:00
Markus Mäkelä
6cebe67374
MXS-1831: Add test case
Added test case that reproduces the problem and verifies that it is fixed.
2018-04-27 12:38:42 +03:00
Markus Mäkelä
bbe59732d8
MXS-1831: Return error on invalid monitor parameter
If a parameter that is not declared by the monitor is altered, an error is
returned instead of it being silently added to the monitor parameters.
2018-04-27 12:38:42 +03:00
Markus Mäkelä
6f80e11f1d
Fix sequence test
The test did not set SQL_MODE to ORACLE before using the Oracle syntax.
2018-04-26 16:02:09 +03:00
Markus Mäkelä
c97d2c94eb
MXS-1825: Fix PS output parameter tracking for MySQL variants
The resultset processing for MySQL requires some extra work as it lacks
the proper SERVER_MORE_RESULTS_EXIST flag in the last EOF packet. Instead,
the first EOF packet has the SERVER_PS_OUT_PARAMS flag which needs to be
interpreted as a SERVER_MORE_RESULTS_EXIST flag for the second EOF packet.

Also corrected the EOF packet handling to do the flag checks in the code
that deals with the EOF packets.

As the modutil_state parameter is now used for more than large packet
tracking, the correct solution is to store this state object in the
readwritesplit session instead of interpreting it to a boolean value.
2018-04-26 16:02:09 +03:00
Markus Mäkelä
260fcf85ec
Remove false debug assertion
A prepared statement ID of 0 is allowed.
2018-04-26 16:02:09 +03:00
Markus Mäkelä
a155d1085c
MXS-1824: Add test case
Added a test case that reproduces the problem and verifies that it is
fixed.
2018-04-26 16:02:09 +03:00
Markus Mäkelä
0df326d581
MXS-1824: Track only the opening of cursors
Whether a cursor is open or not does not matter as long as the attempt to
open a cursor is detected.
2018-04-26 16:02:09 +03:00
Johan Wikman
08230ef24c MXS-1830 Remove erroneous free
The libdir is set elsewhere as well, which causes the set
buffer to be freed. Consequently it cannot be freed.
2018-04-26 15:21:16 +03:00
Johan Wikman
9cf44b3092 MXS-1829 Recognise PREVIOUS in addition to NEXT
Earlier only "SELECT NEXT VALUE FOR SEQ" was parsed
properly, while "SELECT PREVIOUS VALUE FOR SEQ" was not.
Now the latter statement is also parsed properly.
2018-04-26 13:14:23 +03:00
Johan Wikman
b2cc9e5107 MXS-1829 Add test that reveals problem 2018-04-26 12:44:30 +03:00
Johan Wikman
510ce38680 Update 2.2 version number in minor branch 2018-04-25 11:07:55 +03:00
Johan Wikman
dee40a58f4 Update release date 2018-04-25 10:57:49 +03:00
Markus Mäkelä
d9e69413b4
Update MaxScale version
Updated version to 2.2.5.
2018-04-24 23:18:19 +03:00
Esa Korhonen
084c963081 MXS-1639 Update 2.2.5 release notes 2018-04-24 14:36:54 +03:00
Johan Wikman
c221e71582 Merge branch '2.1' into 2.2 2018-04-24 14:31:22 +03:00
Johan Wikman
b401f83e10 Update 2.2.5 release notes 2018-04-24 13:52:26 +03:00
Esa Korhonen
2a38902aa6 MXS-1639 Discard results when executing sql text files
This removes the limitation of not returning resultsets.
2018-04-24 13:21:44 +03:00
Esa Korhonen
fa7cd9450a MXS-1639 Do not run demote_sql_file if the server already has a slave connection
In this case, the server was already a slave and is not being demoted. Also, the file may
contain queries which cannot be ran while a slave connection is running.
2018-04-24 13:21:44 +03:00
Esa Korhonen
2aeed3ffab MXS-1639 Add documentation on promotion/demotion sql files 2018-04-24 13:21:44 +03:00
Johan Wikman
5dbdb8af8a Update 2.1.17 release notes. 2018-04-24 13:05:20 +03:00
Johan Wikman
5cf56c7c0f Merge branch '2.1' into 2.2 2018-04-24 12:39:22 +03:00
Johan Wikman
bafe8f5eeb MXS-1618 Use right type for the return value of getopt_long
getopt_long returns an 'int'. If 'char' is used on a big-endian
platform you'll end up with an infinite loop.
2018-04-24 12:31:08 +03:00
Johan Wikman
e81dd4ab24 Update 2.2.5 release notes 2018-04-24 10:33:19 +03:00
Johan Wikman
e0544c5d9c Update 2.2.5 release notes and change log 2018-04-24 10:18:19 +03:00
Johan Wikman
54b7dee0b0 Add release notes for 2.1.17
Update Changelog as well.
2018-04-24 10:18:19 +03:00
Johan Wikman
57cfb709b8 MXS-1819 Also log info messages to syslog
If info messages are enabled, they will be logged to syslog
just like any other messages.
2018-04-24 10:18:19 +03:00
Johan Wikman
70f3f61ac4 Update version number in 2.1 2018-04-24 10:18:19 +03:00
Johan Wikman
7a81f77649 Add release notes for 2.1.17
Update Changelog as well.
2018-04-24 10:12:29 +03:00
Johan Wikman
65260c365d MXS-1819 Also log info messages to syslog
If info messages are enabled, they will be logged to syslog
just like any other messages.
2018-04-24 10:02:47 +03:00
Johan Wikman
627c1945bc Update version number in 2.1 2018-04-24 09:33:37 +03:00
Markus Mäkelä
7820158f93
Properly fix string truncation in snprint_timestamp
The length of the timestamp string had a practical meaning. The correct
fix was to always use the length passed as the parameter.
2018-04-23 18:21:58 +03:00
Markus Mäkelä
d67320e06a
Fix more GCC 8 build failures
Fixed string truncation warnings by reducing max parameter lengths by one
where applicable. The binlogrouter filename lengths are slightly different
so using memcpy to work around the warnings is an adequate "solution"
until the root of the problem is solved.

Removed unnecessary CMake policy settings from qc_sqlite. Adding a
self-dependency on the source file of an external project has no effect
and only caused warnings to be logged.
2018-04-23 14:02:54 +03:00
Markus Mäkelä
8829e6d0c5
Reorder REST API configuration documentation
The REST API configuration documentation is now located after all other
global parameters in its own section. Added it to the ToC and put a link
to it into the REST API overview document.
2018-04-23 14:02:54 +03:00
Markus Mäkelä
421e64ceeb
Take -Wall into use for tests
Take almost all warnings into use except `format-overflow` and
`unused-function`. format-overflow needs to be handled in a separate
commit.
2018-04-23 14:02:54 +03:00
Markus Mäkelä
0f0913fc99
Fix test build failures with GCC 8
GCC 8 enables -Werror=return-type by default which combined with -Werror
causes the build to fail.
2018-04-23 14:02:53 +03:00
Markus Mäkelä
2c6d27d600
MXS-1815: Use all available CPUs with threads=auto
The documentation stated that all CPUs would be used when threads=auto was
used. In reality the behavior was the same as was with 2.0 (number of CPUs
minus one).
2018-04-20 22:26:32 +03:00
Markus Mäkelä
3d325e29c4
MXS-1814: Log warning with log_debug in release mode
With release mode binaries, the log_debug option has no effect. Now a
warning is logged if the option is used.
2018-04-20 22:26:32 +03:00
Esa Korhonen
739edcbe22 MXS-1639 Run user-given sql commands during promotion, demotion and rejoin
The sql queries are given in two text files, defined by options promotion_sql_file
and demotion_sql_file. The files must exist when monitor starts. The files are read
line by line, ignoring empty lines and lines starting with '#'. All other lines
are sent to the server being promoted, demoted or rejoined. Any error in opening
a file, reading it or executing the contents will cause the entire operation to
fail.

The filed defined in demotion_sql_file is also ran when rejoining a server. This
is to ensure a previously failed master is "demoted" properly when it joins the
cluster.
2018-04-19 17:01:36 +03:00
Markus Mäkelä
474736584b
Fix test_poll failure
With the changes to the DCB handling, the service pointer of a client DCB
must always be assigned.

Also removed the unnecessary parentheses around the comparison.
2018-04-18 08:10:42 +03:00
Markus Mäkelä
ad15f4d4be
Fix binlogrouter build failures with GCC 8
GCC 8 appears to have improved the snprintf truncation detection which
revealed problems in the binlogrouter.
2018-04-17 21:55:47 +03:00
Markus Mäkelä
3a1c2119fb
MXS-1804: Fix hanging of large session commands
Large session commands weren't properly handled which caused the router to
think that the trailing end of a multi-packet query was actually a new
query.

This cannot be confidently solved in 2.2 which is why the router session
is now closed the moment a large session command is noticed.
2018-04-17 15:04:12 +03:00
Markus Mäkelä
232f807ef3
MXS-1808: Only store SQL statements for retrying
Only commands that can contain an SQL statements should be stored for
retrying (COM_QUERY and COM_EXECUTE). Other commands are either session
commands or do not work with query retrying.
2018-04-17 11:25:56 +03:00