Commit Graph

574 Commits

Author SHA1 Message Date
e0c84e0fe3 Added removal of MySQL style comments to query canonicalization.
Also fixed minor issues with the canonicalization regular expressions.
2016-01-11 17:13:14 +02:00
c067bbe34a Formatted the canonical query test.
The file is now formatted according to the style guide.
2016-01-11 17:13:01 +02:00
9c9e30fa08 Fixed value replacement and added more tests for canonicalization of queries
The value replacement was not taking session or system variables into notice.
2016-01-11 17:09:40 +02:00
995ed8c9d2 Improved query canonicalization
The query does not need to be parsed for it to be canonicalized and the parsing
uses the PCRE2 library. The regular expressions were changed so that only one
call to the function which replaces literal unquoted values is made.
2016-01-11 17:08:03 +02:00
f57df4b967 Hide unused public functions
parse_query and query_is_parsed are not used outside query classifier
anymore. Consequently, they can be made internal.
2016-01-11 15:28:00 +02:00
4d155f70b0 Remove call to parse_query.
Not needed anymore.
2016-01-11 15:14:27 +02:00
20bc6a4ab7 Reindent canonizer.c
- Untabify
- Remove trailing whitespace.
- Allman braces.
2016-01-11 15:08:27 +02:00
79fa226000 Move private type to implementation.
parsing_info_t is only used by the query_classifier implementation.
No need to keep it public.
2016-01-11 14:58:15 +02:00
23a7562d3a Replace skygw_ type prefix with qc_.
- skygw_query_type_t renamed to qc_query_type_t.
- skygw_query_op_t renamed to qc_query_op_t.
2016-01-11 12:06:21 +02:00
2f42246880 Rename query classifier functions consistently.
All public query classifier functions now have the prefix qc_.
2016-01-11 12:04:52 +02:00
6e6ad67504 Parse query if it has not been parsed already.
Now consistently all functions parse the query if it has not
been parsed already.
2016-01-11 10:02:27 +02:00
40cfe1a864 Merge branch 'release-1.3.0' into develop 2016-01-08 11:14:02 +02:00
4b21154066 Make private query_classifier functions static.
parsing_info_init and parsing_info_done are only used by
query_classifier. Hence they should not be public and extern.
2016-01-07 22:36:15 +02:00
080a9ebc9d PCRE2 is now statically linked
Since the PCRE2 library was always going to be a part of MaxScale, there was
no real reason to have it as a shared library apart from smaller binaries.
2015-12-29 10:09:38 +02:00
93f10fdb7b Formatted query_classifier
Query_classifier formatted according to the style guide.
2015-12-02 13:36:51 +02:00
a829b38873 Fix to MXS-363: Added soname versions to libraries
The soname version numbers were missing from all the library targets
properties which caused ldconfig to warn about non-symlink libraries
being installed.
2015-11-30 10:46:08 +02:00
a8535f42af Remove all traces of logfile_t
The earlier log file based approach for enabling and disabling
messages has now been completely replaced with the syslog priority
based approach.

Similarly as with log files before it is now possible to enable
and disable a log priority for a particular session, even though
it apparently has not been used much.

The local test-programs of the logging has got minimal attention
only to make them compile. They should get an overhaul as they did
not work before either.
2015-11-23 19:10:53 +02:00
23b2ce004b Added support for MariaDB 10.1 embedded library
The code used in the query classifier was not compatible with 10.1 version
of MariaDB and needed to be fine tuned in order for it to work with all
supported versions of MariaDB.
2015-11-23 11:41:05 +02:00
1bd16db593 query_classifier: LOGIF and skygw_log_write replaced.
The use of LOgIF and skygw_log_write replaced with the equivalent
MXS_[ERROR|WARNING|NOTICE|INFO|DEBUG] macros.
2015-11-16 13:42:37 +02:00
a355e1beef Printf format checking added to logging function.
Printf format checking added to logging function and all
issues that were revealed by that fixed.
2015-11-16 12:40:49 +02:00
dee20fe077 Merge remote-tracking branch 'origin/develop' into MXS-329-develop-20151111
# Conflicts:
#	server/core/CMakeLists.txt
#	server/core/buffer.c
#	server/core/service.c
#	server/modules/filter/tee.c
#	server/modules/monitor/mysql_mon.c
#	server/modules/routing/binlog/blr.c
#	server/modules/routing/binlog/blr_slave.c
#	server/modules/routing/debugcmd.c
#	server/modules/routing/readwritesplit/readwritesplit.c
#	utils/skygw_utils.cc

- resolved.
2015-11-11 11:08:02 +00:00
834a88aeda Log variables moved to log_manager.h
The log manager variables lm_enabled_log_files_bitmask, log_ses_count
and tls_log_info that earlier were declared separately in every
c-file are now declared in the log_manager.h header.
2015-11-04 14:26:53 +02:00
0accf869de Fix to MXS-365: https://mariadb.atlassian.net/browse/MXS-365 Added tracking of LOAD DATA LOCAL INFILE
While a LOAD DATA LOCAL INFILE query is being executed, all queries will be sent to the master
and they will not be processed as normal packets.
2015-11-04 12:47:55 +02:00
9064212353 Fixed queries without assignment operators failing to be properly canonized. 2015-10-27 14:20:43 +02:00
c1194a5ee8 Fixed test build failures. 2015-09-10 18:07:24 +03:00
160bbb70ee MXS-251: strerror
Replaces all calls to strerror with calls to strerror_r. The former
is non-thread safe while the latter is.
2015-09-05 15:52:13 +03:00
d960984bb9 Added NULL check for func_name() 2015-07-20 16:26:34 +03:00
0684cd40ce Fix to MXS-220: https://mariadb.atlassian.net/browse/MXS-220
Switched Item_func::name to Item_func::func_name.
2015-07-20 16:13:47 +03:00
5f49a62724 Fix to MXS-166
Added a call to thd->end_statement in parsing_info_done
2015-05-26 14:41:20 +03:00
5f076b81d4 Merge branch 'install_dir_change' into develop
Conflicts:
	CMakeLists.txt
	Documentation/Tutorials/Administration-Tutorial.md
	log_manager/CMakeLists.txt
	server/core/CMakeLists.txt
	server/core/gateway.c
	server/core/maxkeys.c
	server/core/maxpasswd.c
	server/modules/filter/test/CMakeLists.txt
	server/modules/routing/CMakeLists.txt
2015-05-26 13:34:39 +03:00
c8e5df94be Fixed memory leak in query_classifier. 2015-05-03 09:58:17 +03:00
17a7b2addb Updated more variables. 2015-04-26 20:08:27 +03:00
df9bc65430 Added variables that are used when installing instead of relative paths. 2015-04-25 18:35:47 +03:00
440a6ece59 Fix to MXS-78: https://mariadb.atlassian.net/browse/MXS-78
Literal USE statements are now parsed and classified as a database change queries.
2015-04-02 08:16:45 +03:00
e527508405 Added missing header guards to query classifier.h 2015-03-26 11:54:19 +02:00
15262f3fbf Added new Make target for testing MaxScale's core parts.
This target doesn't need a running MaxScale and only executes core, log_manager and query_classifier unit tests.
2015-03-19 11:56:40 +02:00
9e7afeb302 Merge branch 'develop' into MAX-324
Conflicts:
	macros.cmake
	server/core/config.c
	server/core/service.c
	server/modules/routing/CMakeLists.txt
2015-02-24 06:26:55 +02:00
46c4fefb00 Fixes to coverity defects 87601 87557 87548 87547 87546 87545 87544 87536 87535 87529 87528 2015-02-22 22:29:30 +02:00
a2bff1dcea Merge branch 'develop' into MAX-324 2015-02-16 14:58:35 +02:00
37360eb02e Merge pull request #72 from hholzgra/hartmut-warnings-2nd
"Hartmut warnings 2nd" merged.
2015-02-15 20:26:09 +02:00
3bad5dc814 Fixes to Coverity defects 87308, 87307, 87306, 87074, 87068. 2015-02-14 07:54:17 +02:00
792d4e9c8c fix 'unused value' warning 2015-02-13 16:28:57 +01:00
0d4761ade8 Merge branch 'develop' into MAX-324 2015-02-06 23:27:59 +02:00
32c9d39302 Fix to bug 771: http://bugs.mariadb.com/show_bug.cgi?id=711
SHOW GLOBAL STATUS was misclassified as a global system variable write and was being routed to all servers instead of being routed only to the master.
2015-02-05 18:31:01 +02:00
1348947faa Merge branch 'develop' into MAX-324 2015-01-30 20:58:57 +02:00
a9a9a6eae5 Small fixes to log_manager and query_classifier tests. 2015-01-30 08:26:10 +02:00
db1ea422a0 Merge branch 'develop' into MAX-324
Conflicts:
	server/core/modutil.c
2015-01-20 04:25:40 +02:00
885dfb0242 Merge branch 'remove_makefiles' into develop 2015-01-16 18:04:16 +02:00
c5c9165a26 Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop 2015-01-15 15:21:58 +02:00
39e4253c81 Fix to bug #694, http://bugs.mariadb.com/show_bug.cgi?id=694
query_classifier.cc: set_query_type lost previous query type if the new was more restrictive. Problem was that if query is both READ and SESSION_WRITE and configuration parameter use_sql_variables_in=all was set, routing target became ambiguous. Replaced call to set_query_type with simply adding new type to type (=bit field) and checking unsupported combinations in readwritesplit.c:get_route_target. If such a case is met, a detailed error is written to error log in readwritesplit.c. mysql_client.c sees the error code and sends an error to client. Then mysql_client.c calls router's handleError which ensures that there are enough backend servers so that the session can continue.
2015-01-15 15:16:22 +02:00