Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PREG_CAPTURE and group by - mariadb goes down #29

Open
bezdelnique opened this issue Jun 1, 2017 · 0 comments
Open

PREG_CAPTURE and group by - mariadb goes down #29

bezdelnique opened this issue Jun 1, 2017 · 0 comments

Comments

@bezdelnique
Copy link

Hello.
I have a problem with combination PREG_CAPTURE and group by

Type of field which I am working with: requestUri varchar(255) null

This query works fine

SELECT PREG_CAPTURE('~^(/[^/]+)~', requestUri) as requestUri
FROM `dict_log_error404`

All the rest goes Mariadb down. The only way to make it live is command killall -9 mysqld.

All I need is make to do count.

SELECT PREG_CAPTURE('~^(/[^/]+)~', requestUri) as requestUri, count(*) as cnt
FROM dict_log_error404
group by requestUri

My another try

SELECT PREG_CAPTURE('~^(/[^/]+)~', requestUri) as requestUri
FROM dict_log_error404
where requestUri regexp '^(/[^/]+)'
group by requestUri

.. and another one

select count(*) as cnt, requestUri from
(
   SELECT PREG_CAPTURE('~^(/[^/]+)~', requestUri) as requestUri
   FROM dict_log_error404
   where requestUri regexp '^(/[^/]+)'
) e
group by requestUri

Help me, please.
I like PRCE so much! ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant