[MXS-681] Loading service users error Created: 2016-04-21 Updated: 2016-04-21 Resolved: 2016-04-21 |
|
| Status: | Closed |
| Project: | MariaDB MaxScale |
| Component/s: | Core |
| Affects Version/s: | 1.4.1 |
| Fix Version/s: | 1.4.2 |
| Type: | Bug | Priority: | Major |
| Reporter: | Onno Steenbergen | Assignee: | markus makela |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian GNU/Linux 8.2 (jessie) |
||
| Attachments: |
|
| Description |
|
After a installing MaxScale on a freshly installed VM using the default config (expect server locations) it fails with the following error in the log: 2016-04-21 12:24:48 debug : Dbusers : Loading data from backend database with Master role [10.0.3.26:3306] for service [Read-Write Service] MaxScale doesn't log internal queries so I used tcpdump to capture the query 13:24:55.798079 IP 10.0.3.16.52185 > 10.0.3.26.3306: Flags [P.], seq 2183529305:2183529981, ack 3775999896, win 229, options [nop,nop,TS val 42627172 ecr 42101003], length 676 13:24:55.798440 IP 10.0.3.26.3306 > 10.0.3.16.52185: Flags [P.], seq 3775999896:3776000056, ack 2183529981, win 246, options [nop,nop,TS val 42101003 ecr 42627172], length 160 Looking at the code I think I found the cause in server/core/dbusers.c. It seems that the MAX_QUERY_STR_LEN is incorrect. The definition is: /** The maximum possible length of the query */ While the code in the get_usercount_query function actually uses: snprintf(buffer, MAX_QUERY_STR_LEN, MYSQL_USERS_COUNT_TEMPLATE_START The USERS_QUERY_NO_ROOT seems to be missing in the MAX_QUERY_STR_LEN. |
| Comments |
| Comment by markus makela [ 2016-04-21 ] |
|
The USER_QUERY_NO_ROOT was indeed missing and caused the query to be truncated when 5.7 was used and the root user was not fetched. |