Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parser stack overflow #1013

Closed
giacomoronconiobda opened this issue Nov 9, 2023 · 4 comments
Closed

Parser stack overflow #1013

giacomoronconiobda opened this issue Nov 9, 2023 · 4 comments

Comments

@giacomoronconiobda
Copy link

Describe the bug
Executing a complex query return this message

To Reproduce
DB: https://www.kaggle.com/datasets/seanlahman/the-history-of-baseball
Execute the following query:

Details

WITH FT_0 (x) AS (
  SELECT
    REPLACE(
      REPLACE(
        REPLACE(
          'http://obdasystems.com/ontology/baseballHistory/PostSeasonBattingStatistics/{ALIAS_0}-{ALIAS_1}-{ALIAS_2}',
          '{ALIAS_2}',
          REPLACE(
            REPLACE(
              REPLACE(
                REPLACE(
                  REPLACE(
                    REPLACE(
                      REPLACE(
                        REPLACE(
                          REPLACE(
                            REPLACE(
                              REPLACE(
                                REPLACE(
                                  REPLACE(
                                    REPLACE(
                                      REPLACE(
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  REPLACE(
                                                    REPLACE(
                                                      REPLACE(
                                                        REPLACE(REPLACE(SEL_0.ALIAS_2, '%', '%25'), '@', '%40'),
                                                        ' ',
                                                        '%20'
                                                      ),
                                                      '\\',
                                                      '%5c'
                                                    ),
                                                    '`',
                                                    '%60'
                                                  ),
                                                  '"',
                                                  '%22'
                                                ),
                                                '#',
                                                '%23'
                                              ),
                                              '$',
                                              '%24'
                                            ),
                                            '&',
                                            '%26'
                                          ),
                                          '+',
                                          '%2b'
                                        ),
                                        ',',
                                        '%2c'
                                      ),
                                      '/',
                                      '%2f'
                                    ),
                                    ':',
                                    '%3a'
                                  ),
                                  ';',
                                  '%3b'
                                ),
                                '{',
                                '%7b'
                              ),
                              '[',
                              '%5b'
                            ),
                            '<',
                            '%3c'
                          ),
                          '|',
                          '%7c'
                        ),
                        '=',
                        '%3d'
                      ),
                      '}',
                      '%7d'
                    ),
                    ']',
                    '%5d'
                  ),
                  '>',
                  '%3e'
                ),
                '^',
                '%5e'
              ),
              '~',
              '%7e'
            ),
            '?',
            '%3f'
          )
        ),
        '{ALIAS_1}',
        REPLACE(
          REPLACE(
            REPLACE(
              REPLACE(
                REPLACE(
                  REPLACE(
                    REPLACE(
                      REPLACE(
                        REPLACE(
                          REPLACE(
                            REPLACE(
                              REPLACE(
                                REPLACE(
                                  REPLACE(
                                    REPLACE(
                                      REPLACE(
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  REPLACE(
                                                    REPLACE(
                                                      REPLACE(REPLACE(SEL_0.ALIAS_1, '%', '%25'), '@', '%40'),
                                                      ' ',
                                                      '%20'
                                                    ),
                                                    '\\',
                                                    '%5c'
                                                  ),
                                                  '`',
                                                  '%60'
                                                ),
                                                '"',
                                                '%22'
                                              ),
                                              '#',
                                              '%23'
                                            ),
                                            '$',
                                            '%24'
                                          ),
                                          '&',
                                          '%26'
                                        ),
                                        '+',
                                        '%2b'
                                      ),
                                      ',',
                                      '%2c'
                                    ),
                                    '/',
                                    '%2f'
                                  ),
                                  ':',
                                  '%3a'
                                ),
                                ';',
                                '%3b'
                              ),
                              '{',
                              '%7b'
                            ),
                            '[',
                            '%5b'
                          ),
                          '<',
                          '%3c'
                        ),
                        '|',
                        '%7c'
                      ),
                      '=',
                      '%3d'
                    ),
                    '}',
                    '%7d'
                  ),
                  ']',
                  '%5d'
                ),
                '>',
                '%3e'
              ),
              '^',
              '%5e'
            ),
            '~',
            '%7e'
          ),
          '?',
          '%3f'
        )
      ),
      '{ALIAS_0}',
      REPLACE(
        REPLACE(
          REPLACE(
            REPLACE(
              REPLACE(
                REPLACE(
                  REPLACE(
                    REPLACE(
                      REPLACE(
                        REPLACE(
                          REPLACE(
                            REPLACE(
                              REPLACE(
                                REPLACE(
                                  REPLACE(
                                    REPLACE(
                                      REPLACE(
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  REPLACE(
                                                    REPLACE(REPLACE(SEL_0.ALIAS_0, '%', '%25'), '@', '%40'),
                                                    ' ',
                                                    '%20'
                                                  ),
                                                  '\\',
                                                  '%5c'
                                                ),
                                                '`',
                                                '%60'
                                              ),
                                              '"',
                                              '%22'
                                            ),
                                            '#',
                                            '%23'
                                          ),
                                          '$',
                                          '%24'
                                        ),
                                        '&',
                                        '%26'
                                      ),
                                      '+',
                                      '%2b'
                                    ),
                                    ',',
                                    '%2c'
                                  ),
                                  '/',
                                  '%2f'
                                ),
                                ':',
                                '%3a'
                              ),
                              ';',
                              '%3b'
                            ),
                            '{',
                            '%7b'
                          ),
                          '[',
                          '%5b'
                        ),
                        '<',
                        '%3c'
                      ),
                      '|',
                      '%7c'
                    ),
                    '=',
                    '%3d'
                  ),
                  '}',
                  '%7d'
                ),
                ']',
                '%5d'
              ),
              '>',
              '%3e'
            ),
            '^',
            '%5e'
          ),
          '~',
          '%7e'
        ),
        '?',
        '%3f'
      )
    ) AS x
  FROM
    (
      SELECT
        batting_postseason_V_00238_0.player_id AS ALIAS_0,
        batting_postseason_V_00238_0.year AS ALIAS_1,
        batting_postseason_V_00238_0.round AS ALIAS_2
      FROM
        batting_postseason batting_postseason_V_00238_0
    ) SEL_0
  UNION ALL
  SELECT
    REPLACE(
      REPLACE(
        REPLACE(
          'http://obdasystems.com/ontology/baseballHistory/BattingStatistics/{ALIAS_0}-{ALIAS_1}-{ALIAS_2}',
          '{ALIAS_2}',
          REPLACE(
            REPLACE(
              REPLACE(
                REPLACE(
                  REPLACE(
                    REPLACE(
                      REPLACE(
                        REPLACE(
                          REPLACE(
                            REPLACE(
                              REPLACE(
                                REPLACE(
                                  REPLACE(
                                    REPLACE(
                                      REPLACE(
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  REPLACE(
                                                    REPLACE(
                                                      REPLACE(
                                                        REPLACE(REPLACE(SEL_1.ALIAS_2, '%', '%25'), '@', '%40'),
                                                        ' ',
                                                        '%20'
                                                      ),
                                                      '\\',
                                                      '%5c'
                                                    ),
                                                    '`',
                                                    '%60'
                                                  ),
                                                  '"',
                                                  '%22'
                                                ),
                                                '#',
                                                '%23'
                                              ),
                                              '$',
                                              '%24'
                                            ),
                                            '&',
                                            '%26'
                                          ),
                                          '+',
                                          '%2b'
                                        ),
                                        ',',
                                        '%2c'
                                      ),
                                      '/',
                                      '%2f'
                                    ),
                                    ':',
                                    '%3a'
                                  ),
                                  ';',
                                  '%3b'
                                ),
                                '{',
                                '%7b'
                              ),
                              '[',
                              '%5b'
                            ),
                            '<',
                            '%3c'
                          ),
                          '|',
                          '%7c'
                        ),
                        '=',
                        '%3d'
                      ),
                      '}',
                      '%7d'
                    ),
                    ']',
                    '%5d'
                  ),
                  '>',
                  '%3e'
                ),
                '^',
                '%5e'
              ),
              '~',
              '%7e'
            ),
            '?',
            '%3f'
          )
        ),
        '{ALIAS_1}',
        REPLACE(
          REPLACE(
            REPLACE(
              REPLACE(
                REPLACE(
                  REPLACE(
                    REPLACE(
                      REPLACE(
                        REPLACE(
                          REPLACE(
                            REPLACE(
                              REPLACE(
                                REPLACE(
                                  REPLACE(
                                    REPLACE(
                                      REPLACE(
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  REPLACE(
                                                    REPLACE(
                                                      REPLACE(REPLACE(SEL_1.ALIAS_1, '%', '%25'), '@', '%40'),
                                                      ' ',
                                                      '%20'
                                                    ),
                                                    '\\',
                                                    '%5c'
                                                  ),
                                                  '`',
                                                  '%60'
                                                ),
                                                '"',
                                                '%22'
                                              ),
                                              '#',
                                              '%23'
                                            ),
                                            '$',
                                            '%24'
                                          ),
                                          '&',
                                          '%26'
                                        ),
                                        '+',
                                        '%2b'
                                      ),
                                      ',',
                                      '%2c'
                                    ),
                                    '/',
                                    '%2f'
                                  ),
                                  ':',
                                  '%3a'
                                ),
                                ';',
                                '%3b'
                              ),
                              '{',
                              '%7b'
                            ),
                            '[',
                            '%5b'
                          ),
                          '<',
                          '%3c'
                        ),
                        '|',
                        '%7c'
                      ),
                      '=',
                      '%3d'
                    ),
                    '}',
                    '%7d'
                  ),
                  ']',
                  '%5d'
                ),
                '>',
                '%3e'
              ),
              '^',
              '%5e'
            ),
            '~',
            '%7e'
          ),
          '?',
          '%3f'
        )
      ),
      '{ALIAS_0}',
      REPLACE(
        REPLACE(
          REPLACE(
            REPLACE(
              REPLACE(
                REPLACE(
                  REPLACE(
                    REPLACE(
                      REPLACE(
                        REPLACE(
                          REPLACE(
                            REPLACE(
                              REPLACE(
                                REPLACE(
                                  REPLACE(
                                    REPLACE(
                                      REPLACE(
                                        REPLACE(
                                          REPLACE(
                                            REPLACE(
                                              REPLACE(
                                                REPLACE(
                                                  REPLACE(
                                                    REPLACE(REPLACE(SEL_1.ALIAS_0, '%', '%25'), '@', '%40'),
                                                    ' ',
                                                    '%20'
                                                  ),
                                                  '\\',
                                                  '%5c'
                                                ),
                                                '`',
                                                '%60'
                                              ),
                                              '"',
                                              '%22'
                                            ),
                                            '#',
                                            '%23'
                                          ),
                                          '$',
                                          '%24'
                                        ),
                                        '&',
                                        '%26'
                                      ),
                                      '+',
                                      '%2b'
                                    ),
                                    ',',
                                    '%2c'
                                  ),
                                  '/',
                                  '%2f'
                                ),
                                ':',
                                '%3a'
                              ),
                              ';',
                              '%3b'
                            ),
                            '{',
                            '%7b'
                          ),
                          '[',
                          '%5b'
                        ),
                        '<',
                        '%3c'
                      ),
                      '|',
                      '%7c'
                    ),
                    '=',
                    '%3d'
                  ),
                  '}',
                  '%7d'
                ),
                ']',
                '%5d'
              ),
              '>',
              '%3e'
            ),
            '^',
            '%5e'
          ),
          '~',
          '%7e'
        ),
        '?',
        '%3f'
      )
    ) AS x
  FROM
    (
      SELECT
        batting_V_00212_0.player_id AS ALIAS_0,
        batting_V_00212_0.year AS ALIAS_1,
        batting_V_00212_0.stint AS ALIAS_2
      FROM
        batting batting_V_00212_0
    ) SEL_1
)
SELECT
  FT_0.x AS x
FROM
  FT_0
LIMIT
  1000

**Expected behavior** Maybe I can use some kind of configuration to execute the query (like pragmas?)

Logs
If applicable, provide logs.

Environment (please complete the following information):

  • OS: [e.g. Windows 7]
  • CPU architecture: [e.g. x86_64, arm64]
  • sqlite-jdbc version [e.g. 3.39.2.0]

Additional context
Add any other context about the problem here.

@gotson
Copy link
Collaborator

gotson commented Nov 9, 2023

Executing a complex query return this message

Which message? I don't see anything in the issue.

Did you try the same in the sqlite cli? Does it have the same behavior?

@giacomoronconiobda
Copy link
Author

The message in the title: parser stack overflow. Same message from cli

@gotson
Copy link
Collaborator

gotson commented Nov 10, 2023

If the cli has the same behavior then we can't do much. You can take this to the sqlite forums.

@gotson gotson closed this as not planned Won't fix, can't repro, duplicate, stale Nov 10, 2023
@giacomoronconiobda
Copy link
Author

I think it's the same problem discussed here But I don't know how to set the variables in for the jdbc connection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants