Aadded some of the code from routeQuery to its own function, change_current_db, which extracts db name, tests if the name can be found among cached database names (hashtable) and if it does, change the db. Otherwise create an error message and add it to poll eventqueue like it was sent from some of the backends.

This commit is contained in:
VilhoRaatikka
2014-12-08 23:37:21 +02:00
parent 5a2688e0a5
commit cf40cbfbf0
2 changed files with 132 additions and 48 deletions

View File

@ -265,8 +265,9 @@ typedef enum skygw_chk_t {
#define STRTARGET(t) (t == TARGET_ALL ? "TARGET_ALL" : \
(t == TARGET_MASTER ? "TARGET_MASTER" : \
(t == TARGET_SLAVE ? "TARGET_SLAVE" : \
(t == TARGET_NAMED_SERVER ? "TARGET_NAMED_SERVER" : \
(t == TARGET_UNDEFINED ? "TARGET_UNDEFINED" : \
"Unknown target value"))))
"Unknown target value")))))
#define BREFSRV(b) (b->bref_backend->backend_server)