Skip to content

PREG_CAPTURE and group by - mariadb goes down #29

@bezdelnique

Description

@bezdelnique

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! ;)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions