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

accessing user variables in views

    XMLWordPrintable

Details

    • Bug
    • Status: Open (View Workflow)
    • Minor
    • Resolution: Unresolved
    • 10.10.3, 10.4(EOL)
    • 10.4(EOL)
    • Views
    • Windows

    Description

      According to documentation, regarding Views: "Within a stored program, the definition cannot refer to program parameters or local variables". Apparently in practice that does not work, following code completely bypass that rule:

      DELIMITER $$
      CREATE FUNCTION f()
      RETURNS TEXT
      BEGIN
      RETURN @d;
      END;$$
      DELIMITER ;
      SET @d='6';
      CREATE VIEW v1 AS select f() AS F;
      select * FROM v1;
      

      Honestly, I am not complaining for that particular inconsistency, I however wonder if you intend to keep it or fix it, in future releases?
      It might be useful to have an ability to manipulate views or be able to retain some of subroutine state between its consecutive executions (this way some optimizations can be done), using at least user variables.

      Attachments

        Activity

          People

            sanja Oleksandr Byelkin
            v3ctor Jan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Git Integration

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