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,8 +1,8 @@
/**
* Test SEQUENCE related commands
*
* This test is only enabled when the backend version is 10.3
*/
* Test SEQUENCE related commands
*
* This test is only enabled when the backend version is 10.3
*/
#include "testconnections.h"
#include <vector>
@ -15,32 +15,36 @@ int main(int argc, char** argv)
test.maxscales->connect();
test.try_query(test.maxscales->conn_rwsplit[0], "CREATE SEQUENCE seq");
std::vector< std::pair<const char*, const char*> > statements =
std::vector<std::pair<const char*, const char*>> statements =
{
{ "SELECT NEXT VALUE FOR seq", "1" },
{ "SELECT PREVIOUS VALUE FOR seq", "1" },
{ "SELECT NEXTVAL(seq)", "2" },
{ "SELECT LASTVAL(seq)", "2" },
{"SELECT NEXT VALUE FOR seq", "1"},
{"SELECT PREVIOUS VALUE FOR seq", "1"},
{"SELECT NEXTVAL(seq)", "2"},
{"SELECT LASTVAL(seq)", "2"},
};
for (auto a : statements)
{
test.assert(execute_query_check_one(test.maxscales->conn_rwsplit[0], a.first, a.second) == 0,
"Expected '%s' for query: %s", a.second, a.first);
"Expected '%s' for query: %s",
a.second,
a.first);
}
test.try_query(test.maxscales->conn_rwsplit[0], "SET SQL_MODE='ORACLE'");
std::vector< std::pair<const char*, const char*> > oracle_statements =
std::vector<std::pair<const char*, const char*>> oracle_statements =
{
{ "SELECT seq.nextval", "3" },
{ "SELECT seq.currval", "3" },
{"SELECT seq.nextval", "3"},
{"SELECT seq.currval", "3"},
};
for (auto a : oracle_statements)
{
test.assert(execute_query_check_one(test.maxscales->conn_rwsplit[0], a.first, a.second) == 0,
"Expected '%s' for query: %s", a.second, a.first);
"Expected '%s' for query: %s",
a.second,
a.first);
}
test.try_query(test.maxscales->conn_rwsplit[0], "DROP SEQUENCE seq");