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

LP:881710 - Column name PID returns NULL when called via SP

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Resolution: Incomplete
    • None
    • None
    • None

    Description

      I have a very simple table like this:

      CREATE TABLE `path` (
      `PID` int(10) unsigned NOT NULL,
      `PPath` varchar(2000) NOT NULL,
      `PHash` binary(16) NOT NULL,
      PRIMARY KEY (`id`)
      ) ENGINE=InnoDB;

      And a SP:

      create procedure test(path VARCHAR(2000))
      begin

      DECLARE pid INT UNSIGNED;
      DECLARE hash BINARY(16) DEFAULT UNHEX(MD5(path));

      SELECT PID FROM path LIMIT 1;

      end|
      call test("/")|

      Calling the procedure test() returns NULL. Upper and lower case doesn't matter. Renaming the column to something different like

      alter table path change PID id int unsigned;

      returns the correct result.

      Attachments

        Activity

          People

            Unassigned Unassigned
            robert Robert (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 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.