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

JSON_OBJECT does not respect variable types INT or DECIMAL in stored procedures

    XMLWordPrintable

Details

    • Bug
    • Status: Confirmed (View Workflow)
    • Major
    • Resolution: Unresolved
    • 10.2.10, 10.2, 10.3, 10.4, 10.5, 10.6, 10.9, 10.10, 10.11, 11.0, 11.1, 11.2
    • 10.4, 10.5, 10.6, 10.11, 11.0, 11.1, 11.2
    • JSON
    • None
    • Ubuntu 14.04

    Description

      Test case:

      DROP PROCEDURE IF EXISTS test;
       
      DELIMITER ;;
       
      CREATE PROCEDURE test()
      BEGIN
        DECLARE i INT UNSIGNED DEFAULT 10;
        DECLARE d DECIMAL(2,1) UNSIGNED DEFAULT 1.5;
        
        SELECT JSON_OBJECT('int_variable', i, 'int_literal', 20, 'decimal_variable', d, 'decimal_literal', 2.6 );
        
      END;;
       
      DELIMITER ;
      CALL test;
      

      Returns:

      +---------------------------------------------------------------------------------------------------+
      | JSON_OBJECT('int_variable', i, 'int_literal', 20, 'decimal_variable', d, 'decimal_literal', 2.6 ) |
      +---------------------------------------------------------------------------------------------------+
      | {"int_variable": "10", "int_literal": 20, "decimal_variable": "1.5", "decimal_literal": 2.6}      |
      +---------------------------------------------------------------------------------------------------+
      

      Attachments

        Activity

          People

            rucha174 Rucha Deodhar
            Rich Rich Theobald
            Votes:
            2 Vote for this issue
            Watchers:
            5 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.