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.
This commit is contained in:
Niclas Antti
2018-09-09 22:26:19 +03:00
parent fa7ec95069
commit c447e5cf15
849 changed files with 35002 additions and 27238 deletions

View File

@ -1,29 +1,30 @@
/**
* @file bug587.cpp regression case for the bug 587 ( "Hint filter don't work if listed before regex filter in configuration file" )
* @file bug587.cpp regression case for the bug 587 ( "Hint filter don't work if listed before regex filter
*in configuration file" )
*
* - Maxscale.cnf
* @verbatim
[hints]
type=filter
module=hintfilter
[regex]
type=filter
module=regexfilter
match=fetch
replace=select
[RW Split Router]
type=service
router= readwritesplit
servers=server1, server2, server3,server4
user=skysql
passwd=skysql
max_slave_connections=100%
use_sql_variables_in=all
router_options=slave_selection_criteria=LEAST_BEHIND_MASTER
filters=hints|regex
@endverbatim
* [hints]
* type=filter
* module=hintfilter
*
* [regex]
* type=filter
* module=regexfilter
* match=fetch
* replace=select
*
* [RW Split Router]
* type=service
* router= readwritesplit
* servers=server1, server2, server3,server4
* user=skysql
* passwd=skysql
* max_slave_connections=100%
* use_sql_variables_in=all
* router_options=slave_selection_criteria=LEAST_BEHIND_MASTER
* filters=hints|regex
* @endverbatim
* - second test (bug587_1) is executed with "filters=regex|hints" (dffeent order of filters)
* - check if hints filter working by executing and comparing results:
* + via RWSPLIT: "select @@server_id; -- maxscale route to server server%d" (%d - node number)
@ -32,33 +33,34 @@ filters=hints|regex
*/
/*
Vilho Raatikka 2014-10-21 19:12:33 UTC
If filters and rwsplit are configured as follows, hints don't work.
[hints]
type=filter
module=hintfilter
[regex]
type=filter
module=regexfilter
match=fetch
replace=select
[RW Split Router]
type=service
router=readwritesplit
servers=server1,server2,server3,server4
max_slave_connections=100%
use_sql_variables_in=all
user=maxuser
passwd=maxpwd
filters=hints|regex
Changing filters=regex|hints makes it work. This is due to processing order. Regex filter drops hint off.
Comment 1 Vilho Raatikka 2014-10-23 18:08:07 UTC
buffer.c:gwbuf_make_contiguous: hint wasn't duplicated to new GWBUF struct. As a result hints were lost if query rewriting resulted in longer query than the original.
*/
* Vilho Raatikka 2014-10-21 19:12:33 UTC
* If filters and rwsplit are configured as follows, hints don't work.
*
* [hints]
* type=filter
* module=hintfilter
*
* [regex]
* type=filter
* module=regexfilter
* match=fetch
* replace=select
*
* [RW Split Router]
* type=service
* router=readwritesplit
* servers=server1,server2,server3,server4
* max_slave_connections=100%
* use_sql_variables_in=all
* user=maxuser
* passwd=maxpwd
* filters=hints|regex
*
* Changing filters=regex|hints makes it work. This is due to processing order. Regex filter drops hint off.
* Comment 1 Vilho Raatikka 2014-10-23 18:08:07 UTC
* buffer.c:gwbuf_make_contiguous: hint wasn't duplicated to new GWBUF struct. As a result hints were lost if
* query rewriting resulted in longer query than the original.
*/
#include <iostream>
@ -67,9 +69,9 @@ buffer.c:gwbuf_make_contiguous: hint wasn't duplicated to new GWBUF struct. As a
using namespace std;
int main(int argc, char *argv[])
int main(int argc, char* argv[])
{
TestConnections * Test = new TestConnections(argc, argv);
TestConnections* Test = new TestConnections(argc, argv);
Test->set_timeout(10);
Test->repl->connect();
Test->maxscales->connect_maxscale(0);
@ -87,8 +89,11 @@ int main(int argc, char *argv[])
sprintf(hint_sql, "select @@server_id; -- maxscale route to server server%d", j + 1);
Test->tprintf("%s\n", hint_sql);
find_field(Test->maxscales->conn_rwsplit[0], hint_sql, (char *) "@@server_id", &server_id[0]);
find_field(Test->repl->nodes[j], (char *) "select @@server_id;", (char *) "@@server_id", &server_id_d[0]);
find_field(Test->maxscales->conn_rwsplit[0], hint_sql, (char*) "@@server_id", &server_id[0]);
find_field(Test->repl->nodes[j],
(char*) "select @@server_id;",
(char*) "@@server_id",
&server_id_d[0]);
Test->tprintf("server%d ID from Maxscale: \t%s\n", j + 1, server_id);
Test->tprintf("server%d ID directly from node: \t%s\n", j + 1, server_id_d);
@ -106,5 +111,3 @@ int main(int argc, char *argv[])
delete Test;
return rval;
}