8352 Commits

Author SHA1 Message Date
Johan Wikman
4034931013 MXS-1247 Update mkopcodeh.tcl of sqlite3
With sqlite3 3110100, which is used in MaxScale, the the generation
of the used op-codes could sometime generate code that did not define
all opcodes. That resulted then in a compilation error like:

.../sqlite-bld-3110100/sqlite3.c: In function 'sqlite3VdbeExec':
.../sqlite-bld-3110100/sqlite3.c:75427:6: error: 'OP_Real' undeclared
                                          (first use in this function)
 case OP_Real: {            /* same as TK_FLOAT, out2 */
      ^

The reason seems to be that if a particular op-code was not used, the
generation stopped at that point:

    #define OP_Explain       160
    #define OP_NotUsed_161   161

With mkopcodeh.tcl from sqlite3 version 3200000, the generated code
looks like

    #define OP_NotUsed_161   161
    #define OP_Real          162 /* same as TK_FLOAT,
                                    synopsis: r[P2]=P4       */

and the code compiles.

Thus, mkopcodeh.tsl is updated from the newer sqlite3 version.
2017-08-16 10:17:27 +03:00
Johan Wikman
de7004cb95 Merge branch '2.1' into develop 2017-08-15 10:31:30 +03:00
geaaru
3485a32731 Fix compilation errors/warning with gcc-5.4.0 (#137)
Warning are like this:
 error: ‘delimiter’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
2017-08-15 09:56:22 +03:00
Johan Wikman
49ba1f8fa0 MXS-1360 Add 'thread_stack_size' configuration value
Using the 'thread_stack_size' configuration value, the stack size
of the worker threads can be adjusted.
2017-08-14 15:31:00 +03:00
Johan Wikman
e9b2a560b8 MXS-1360 Make it possible to specify thread stack size
It is now possible to specify the thread stack size to be used,
when a new thread is created. This will subsequently be used
for allowing the stack size to be specified for worker threads.
2017-08-14 15:24:16 +03:00
MassimilianoPinto
bdb0f7d8d7 Binlog server: error message was truncated due to error size computation.
Binlog server: error message was truncated due to error size
computation.
2017-08-14 13:41:04 +02:00
Johan Wikman
c662bea983 MXS-1359 Turn recursion into iteration
In case of very large compound selects or an INSERT with many
values, qc_sqlite could run out of stack space. To deal with
that, the critical recursion is turned into an iteration.
2017-08-14 13:29:19 +03:00
Johan Wikman
4798810f76 Merge branch '2.1' into develop 2017-08-14 10:36:34 +03:00
Johan Wikman
7021041804 Update 2.1.6 release date 2017-08-14 10:06:27 +03:00
Markus Mäkelä
9d3772a67e MXS-1262: Minor improvements to monitor journals
Moved 4 byte get/set into utils header. The byte packing functions in
maxscale/protocol/mysql.h should be migrated to the utils directory where
they can also be used by non-mysql code.

The temporary files are now generated with mkstemp. This will prevent
conflicts with multiple monitors operating on the same temporary journal
even though it is impossible in practice.

Added missing error messages to a couple of the functions.
2017-08-11 11:35:13 +03:00
Markus Mäkelä
b768d3ca76 MXS-1356: Allow tee filter to be disabled at runtime
Disabling the tee filter at runtime is desirable for cases where the
branched service is not always needed. Migrations and pre-production
setups are one where changes to the branched service are expected and
splitting the queries would result in an error.
2017-08-11 04:09:08 +03:00
Markus Mäkelä
53bf21f785 MXS-1262: Use monitor journals in all monitors
All monitors now persist the state of the server in a monitor journal
file.

Moved the removal of stale journals into the core and removed them from
the monitor journal interface.
2017-08-11 04:09:08 +03:00
Markus Mäkelä
b448b129d0 MXS-1262: Move journal_max_age to MaxScale core
The parameter is now defined in the monitor. Further refactoring is needed
to make the interface of the journal system simpler.
2017-08-11 04:09:08 +03:00
Markus Mäkelä
837d57f4f4 MXS-1262: Move monitor journals into the core
The journaling functionality is now in the core. Only the MySQL Monitor is
using it.
2017-08-11 04:09:07 +03:00
Johan Wikman
4dc41509af MXS-1337 Move more functions to QcSqliteInfo 2017-08-10 16:09:58 +03:00
Johan Wikman
8ce5147d39 MXS-1337 Moved functions to QcSqliteInfo 2017-08-10 15:57:48 +03:00
Johan Wikman
54a75a1752 MXS-1337 Move update_field_infos_from[sub]select to QcSqliteInfo 2017-08-10 15:45:25 +03:00
Johan Wikman
9d97902899 MXS-1307 CTE tests pass
There are some issues still
- With recursive CTEs qc_mysqlembedded and qc_sqlite agree upon
  the real columns, but disagree on the CTE related "virtual"
  columns. That's largely irrelevant though.
- qc_sqlite cannot parse "SET STATEMENT var=... FOR stmt",
  but it will be classified as QUERY_TYPE_GSYSVAR_WRITE.
  This is not directly CTE related.
2017-08-10 15:23:42 +03:00
Johan Wikman
4eeff705ee MXS-1307 Catch "union all" selects 2017-08-10 14:45:27 +03:00
Johan Wikman
05bbd9676b MXS-1307 Ignore usage differences for functions
Also in the case of functions, we ignore differences in reported
usage context between qc_mysqlembedded and qc_sqlite.
2017-08-10 12:54:47 +03:00
Johan Wikman
878bbe4a98 MXS-1307 Aliases must be stored hierarchically
Alias handling must be made so that in a subselect, aliases created
in an outer select are available, but aliases created in another
subselect are not.
2017-08-10 11:43:09 +03:00
MassimilianoPinto
ca7aadeb24 Bingo Tutorial shows complete configuration example.
Bingo Tutorial shows complete configuration example.
2017-08-10 10:18:50 +02:00
MassimilianoPinto
87a48919e8 Release Notes 2.1.6 update
Release Notes 2.1.6 update
2017-08-10 10:10:56 +02:00
MassimilianoPinto
424c7b7ad3 MXS-1343: documentation update.
MXS-1343: documentation update for new option ‘slave_hostname’
2017-08-10 09:49:01 +02:00
Markus Mäkelä
9b9d7e4c4d Generate a list of all fixed issues
The list_fixed_bugs.sh script now also shows issues that aren't bugs.
2017-08-10 10:37:13 +03:00
Markus Mäkelä
d60df103bf Add avrorouter binlog checksum to limitations
Added a note about the avrorouter binlog checksums to the limitations
document.
2017-08-10 10:33:09 +03:00
Markus Mäkelä
ebe9596966 MXS-1345: Allow an empty list of functions
The function type rule now accepts an empty list of functions, allowing
all functions to be blocked by defining an empty function type rule and
setting action=allow.
2017-08-10 09:51:31 +03:00
Timofey Turenko
0d2514b9ce fix kerberos setup files copying 2017-08-10 08:42:26 +03:00
MassimilianoPinto
7da092843f MXS-1343: send hostname to master with COM_REGISTER_SLAVE
A new option ‘slave_hostname’ allows the setting of hostname in
COM_REGISTER_SLAVE.

SHOW SLAVES HOSTS; in master server can show the hostname set in binlog
router:

MariaDB [(none)]> SHOW SLAVE HOSTS;
+-----------+-----------------------------+------+-----------+
| Server_id | Host                        | Port | Master_id |
+-----------+-----------------------------+------+-----------+
|        93 | maxscale-blr-1.mydomain.net | 8808 |     10124 |
+-----------+-----------------------------+------+-----------+
2017-08-09 17:09:50 +02:00
Esa Korhonen
7ba0533cc8 Authenticator API extract-entrypoint returns bool
Extraction either succeeds or fails, it does not need to return
defined integer values.
2017-08-09 17:28:58 +03:00
Markus Mäkelä
f336cb63cf Fix FindPam.cmake
The variables weren't set the into the variable cache for some reason.
2017-08-09 16:18:12 +03:00
Johan Wikman
6bdc2de6fe MXS-1307 Detect field usage from all selects
In the presence of CTEs, in order to catch all field usage, we need
to iterate over all selects.
2017-08-09 13:21:24 +03:00
Johan Wikman
aeb881afea MXS-1337 Better sqlite3 initialization
The sqlite3 initialization is done a bit more properly now.
It is also ensured that issues are logged at most once, even
if a statement is parsed twice.
2017-08-09 13:21:24 +03:00
Markus Mäkelä
05ac06c901 Use same object files for all packages
There's no need to rebuild the object files for each component. Reusing
them should allow for a faster build.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
80569dd5a9 MXS-1300: Correct test case descriptions
The test descriptions now describe the expected logical outcome of the
test, not the operation being done.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
d64cb9fa80 MXS-1300: Test calling of module commands via MaxCtrl
The calling of module commands is tested by using the qlafilter log
command.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
9847b36a12 Fix invalid module command argument count
The module commands were always given the maximum argument count even if
less arguments were given.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
d09e0d03bc MXS-1347: Expose unified log file as a module command
The qlafilter exposes the unified log file as a module command that
outputs an array of JSON strings, one for each line in the file. The
command takes two optional parameters, the start and end lines for the log
file.

Further improvements could be done to allow reading of session specific
log files.

Some sort of an authorization scheme for the REST API should be
implemented to limit the possibility of exposing unwanted parts of the
REST API.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
826654b9de MXS-1300: Build MaxCtrl with experimental packages
The build scripts now download Node.js 6.11.2 for building and packaging
MaxCtrl. The client package is also created when the extra packages are
built.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
7c38a56ea2 MXS-1300: Add client as a valid package name
The MaxCtrl component, `client`, needs to be in the list of valid
component names.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
c2a2688b93 Fix duplicate listener checks
Only the protocol, port and address of the listener were used to check if
a listener exists. The check should also use the name of the listener to
be sure that each name is unique.

Expanded tests to check that the creation of duplicate listeners is
detected. Did minor improvements to related test code.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
c593a1bf32 MXS-1300: Test cluster diff functionality
The `cluster diff` command is now tested by doing add/alter/remove
operations on servers. As the same methods are used for all objects, they
should detect all sorts of modifications between two Maxscales.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
70ae93a9ab MXS-1300: Move service checks in cluster to a function
The check that the two MaxScales have the same services is now in a common
function. Added more details into the error message as to why the command
failed. The hosts and their extra services are logged for both the source
and target of the command.

The `cluster diff` command could display the extra services in the diff
but this could be interpreted as a sign that MaxScale could act on that
part of the diff. Returning an error instead of silently ignoring the
extra services should allow for a more consistent user experience.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
f422e92496 MXS-1300: Return output instead of printing it
The `execute` command now returns the output of the command instead of
printint it. This allows the tests to actually test the output of the
commands instead manually verifying that it is correct. It also allows the
library part to be used as an actual library that only returns data.
2017-08-09 11:39:25 +03:00
Markus Mäkelä
9a04dd0311 MXS-1300: Resolved the promise for help commands
The promise returned by the `execute` MaxCtrl library function is now
properly resolved also for `help` type commands.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
527ada770c MXS-1300: Fix double maxscale startup script and configuration
The configuration wrongly spelled `secondary` as `secodary` causing a
failure to start the secondary MaxScale. The startup script didn't create
the log directory and removed the wrong maxadmin socket file.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
1308e7a304 Fix resource collection modification times
The resource collection modification times weren't updated when an
individual resource was updated. By tracking back the path of a resource
and updating the modification times, all nodes in the path will get the
correct modification time.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
7e18e49eec MXS-1220: Move request body checks to a higher level
The checks whether a request body is present are now done at a higher
level. This removes the need to do the checks at the resource handler
callback, removing duplicated code.

The checks are done by adding constraints to resources that must be
fulfilled by each request.

Added debug assertions to make sure that the core logic of the REST API
resource system works.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
1b65bd2a9d Improve runtime listener creation error messages
The error messages for listener creation are now more detailed. In
addition to this, they are also conveyed to the runtime error system.
2017-08-09 11:39:24 +03:00
Markus Mäkelä
0ab7df88dc MXS-1300: Fix MaxCtrl cluster sync test for listeners
The test is not very useful for a locally hosted setup as both MaxScales
can't bind to the same port.
2017-08-09 11:39:24 +03:00