Uploaded image for project: 'MariaDB Server'
  1. MariaDB Server
  2. MDEV-14620

Regexp not matching dash (-)

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Not a Bug
    • 5.5.56
    • N/A
    • Server
    • None

    Description

      Hello.
      Need to use regexp aliases with Postfixadmin.
      Standard Postfixadmin alias table

       CREATE TABLE `alias` (
        `address` varchar(255) NOT NULL,
        `goto` text NOT NULL,
        `domain` varchar(255) NOT NULL,
        `created` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
        `modified` datetime NOT NULL DEFAULT '2000-01-01 00:00:00',
        `active` tinyint(1) NOT NULL DEFAULT '1',
        PRIMARY KEY (`address`),
        KEY `domain` (`domain`)
      ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Aliases'
      

      Inserted alias with regexp

      INSERT INTO alias VALUES ('tks\.[0-9a-z\-\_\.]+@example.com','tks@example.com','example.com',NOW(),NOW(),1);
      

      Selecting email with dash returns empty dataset

      SELECT goto FROM alias WHERE 'tks.te-st@example.com' REGEXP CONCAT('^',address,'$') AND SUBSTRING(address,1,1) != '@';
      Empty set (0.00 sec)
      

      Point (tks.te.st@example.com) and underscore (tks.te_st@example.com) matches well.

      Checked same on MySQL 5.1.73 - dash matching without any problem.

      Attachments

        Activity

          People

            Unassigned Unassigned
            Kram Dron Kram
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.