Commit Graph

1022 Commits

Author SHA1 Message Date
a5012c6a80 Fix signed/unsigned compilation error 2018-03-22 16:49:36 +02:00
98aa9c8d5b MXS-1475 Fix unit-test program 2018-03-21 15:58:12 +02:00
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
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
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
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
3331eb9eb6 MXS-1475 Fix typos 2018-03-16 14:34:04 +02:00
51251fd9f3 MXS-1475 Introduce @maxscale.cache.[soft_ttl|hard_ttl]
Now it is possible to control the soft and hard ttl of the
cache on a session basis. That is, it is possible to use
different TTLs for different SELECTs.
2018-03-16 14:34:04 +02:00
2c49f90bc4 MXS-1475 Allow caller to specify (soft|hard) TTL
As the TTL is checked at lookup time, it need not be hardwired
when the storage instance is created. With this changed it is
possible to introduce @maxscale.cache.(soft|hard)_ttl user
variables using which a client can control what TTL should be
applied for a particular kind of data, which is requested by
MXS-1475.
2018-03-16 14:34:04 +02:00
0ef902621d MXS-1475 Update cache entry if originally present
In case the entry in the cache can not be used because the hard
TTL has kicked in, we fetch the data and update the cache
irrespected of the value if @maxscale.cache.populate. That way
an entry that once was put in the cache, will remain in the cache
(as long as there is space).
2018-03-16 14:34:04 +02:00
4ce894d24d MXS-1475 Report if hard TTL has hit in
If an entry is not returned because the hard TTL had hit in,
we tell about it so that the caller can act differently in that
case.
2018-03-16 14:34:04 +02:00
38d20c1575 MXS-1475 Remove all traces of RocsDB cache storage
Some API changes are needed and it's not time well spent to
update the RocksDB storage implementation.
2018-03-16 14:34:04 +02:00
2ec19e2358 MXS-1475 Add test case for @maxscale.cache.[use|populate]
Also extend logging.
2018-03-16 14:34:04 +02:00
82b55ff362 MXS-1475 Add @maxscale.cache.[populate|use]
The earlier @maxscale.cache.enabled has now been replaced with
@maxscale.cache.populate and @maxscale.cache.use that provide
for more flexibility.

With the former it is possible to control in what circumstances
the cache is populated and with the latter one when it is used.
Together they can be used for having a completely client driven
caching.
2018-03-16 14:34:04 +02:00
2d20a19f12 MXS-1475 Act accordingly if cache disabled
If caching is dynamically disabled, then CACHE_USE_AND_POPULATE is
turned into CACHE_POPULATE leading to the cache being refreshed but
not used.
2018-03-16 14:34:04 +02:00
090892db4c MXS-1475 Add 'enabled' parameter to Cache filter
With 'enabled' it can be specified whether the cache should initially
be enabled or disabled. Useful as it is now possible to enable/disable
the cache dynamically.
2018-03-16 14:34:04 +02:00
71c8a327b2 MXS-1475 Introduce variable @maxscale.cache.enabled
With the variable @maxscale.cache.enabled the caching can be
enabled/disabled at runtime.

In a subsequent commit, the variable will actually be used.
2018-03-16 14:34:04 +02:00
ea83420620 Merge branch '2.2' into develop 2018-03-01 18:08:45 +02:00
544e0eb60b Merge branch '2.1' into 2.2 2018-03-01 17:57:40 +02:00
b46c52d65c MXS-1684 Match space+linefeed as linefeed
A linefeed is whitespace, so given the rules

  "\n"+    return '\n'
  {SPACE}  ;

a line consisting of space followed by a linefeed, will be matched
as space and not as a linefeed and hence will cause the parser to
barf.
2018-03-01 17:57:07 +02:00
5326c8db5c Merge branch '2.2' into develop 2018-02-08 12:48:06 +02:00
b15a460416 MXS-1659 Do not include C++ headers from C header 2018-02-08 12:45:18 +02:00
771716e9db Merge branch '2.2' into develop 2018-02-05 10:22:43 +02:00
ea58b16a7a Add missing include for vector
The vector header was not included in dbfwfilter.hh.
2018-01-30 19:14:28 +02:00
c7474e439e Print new parameters during diagnostics
Also, copy using strdup instead since config_copy_string()
returns null for empty strings.
2018-01-30 18:40:33 +02:00
0db538db9a MXS-1583 Treat independent 'users' line in OR-fashion
If there are several 'users' lines in a rule file, for a particular
user, the rules each matching line will be checked independently
until a rule match is found.

That is, the rules of each 'users' line are treated in an OR-fashion
with respect to each other.
2018-01-29 15:25:21 +02:00
1222d2a400 Use C-string as parameter to fix compile error 2018-01-23 12:28:15 +02:00
0bcae6117d Fix compilation errors by using defines in mysql.h 2018-01-23 12:18:52 +02:00
459d4bb002 Turn QLA filter to C++, part1 2018-01-19 16:58:06 +02:00
998652bf24 Merge branch '2.2' into develop 2018-01-19 11:47:45 +02:00
7c7190e0c4 Fix index overflow in masking filter 2018-01-19 09:55:20 +02:00
beac04b8e7 MXS-1616 Also use 'value' in partial matching
As you can create regular expressions that have a fixed length,
e.g. "....$", it makes perfect sense to replace using 'value' if
the length of the string matches exactly.
2018-01-18 09:48:38 +02:00
c02da103d7 MXS-1615 Fix access of wrong argument
- Wrong argument accessed at command invocation. In debug mode
  leads to crash, in release mode probably leads to crash.
- Log result of reload.
2018-01-17 13:59:00 +02:00
1d211ecee2 MXS-1511: QLA-Filter replace newlines in SQL-queries with custom strings
The config parameter 'newline_replacement' (defaults to 1 space " ") now defines
what to write to the log file when the sql-query has a newline sequence (\n, \r or
\r\n). If 'newline_replacement' is the empty string "", no replacing is done and
newlines are printed to file.

Also, adds the config parameter 'separator', which defines the string
printed between elements. Default value is ",".
2018-01-16 14:25:19 +02:00
df70f23635 Merge branch '2.2' into develop 2018-01-16 09:51:13 +02:00
14f1bbed51 NamedServerFilter: Deprecate message for legacy parameter use 2018-01-15 15:30:38 +02:00
8026cb5423 Merge branch '2.2' into develop 2018-01-05 09:58:37 +02:00
224f918845 MXS-1592 Make all modules lowercase
Make all modules lowercase and make module loading case
insensitive. Further, make command invocation case insensitive,
as far as the module name is conserned.
2018-01-03 14:57:18 +02:00
e8f52951d1 Merge branch '2.2' into develop 2018-01-03 14:07:09 +02:00
9689271a34 MXS-1541: Use session ID in topfilter
The topfilter now uses the session ID as the filename suffix.
2018-01-03 08:56:41 +02:00
810a9d6183 Merge branch '2.2' into develop 2018-01-02 10:13:57 +02:00
cf29430476 Merge branch '2.1' into 2.2 2018-01-02 09:31:07 +02:00
95983ddaf4 Fix unit test failures
When the unit tests were run without installing the libraries in their
final locations, the loading of the modules would fail. Using locations
relative to the build directory allows unit testing without having to
install the libraries.
2017-12-29 10:09:16 +02:00
e0f5c48c16 MXS-701: Update Filter Documentation
MXS-701: Update Filter Documentation
2017-12-11 16:06:06 +01:00
37a1431ef2 MXS-701: RAND_EVENT nows has the two seeds filled
MXS-701: RAND_EVENT nows has the two seeds filled with original packet
size and original event type:

#700101  1:00:00 server id 0  end_log_pos 0 CRC32 0x858bdfd5 	Rand
SET @@RAND_SEED1=62, @@RAND_SEED2=19/*!*/;
2017-12-07 11:24:37 +01:00
cf627203cb Fix issues revealed on CentOS6 2017-12-02 13:42:15 +02:00
481892b452 MXS-1512 Add test case for cache options
Here's now tested that the cache properly deals with the configuration
setting "cache_in_transactions" and the current transaction state.
2017-11-29 12:41:34 +02:00
b225eeff2c MXS-1512 Allow autocommit and trx state to be set for a session
When mocking you want to be able to set explicitly how a filter
session should see the current context.
2017-11-29 12:41:34 +02:00
02cf284b61 MXS-1512 Add mock Backend class that can generate resultsets 2017-11-29 12:41:34 +02:00
6d66ffe9f7 Use FilterModule::ConfigParameters in test_dbfwfilter 2017-11-29 12:41:34 +02:00