Skip to content

[Bug]: Table 'dmarc.report' doesn't exist #104

Description

@szurmandev

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to install.php
  2. See error:
    connecting to database... success
    opening file... success
    → CREATE VIEW IF NOT EXISTS report_stats AS (
    → SELECT
    → report.serial, domain, rcount, disposition, reason,
    → policy_p, policy_pct, dkimdomain, dkimresult, dkim_align,
    → spfdomain, spfresult, spf_align, mindate, maxdate
    → FROM report RIGHT JOIN rptrecord
    → ON report.serial=rptrecord.serial
    → );
    performing query... failed: Table 'dmarc.report' doesn't exist

Expected behavior
sql will not execute

Software Version
[x] Version 1

Desktop (please complete the following information):

  • OS Window 11
  • Browser Google Chrome
  • Version 121.0.6167.185

Server (please complete the following information):

  • Server OS Debian
  • Web Server Apache/2.4.38 (Debian)
  • PHP Version 7.4.33
  • SQL Variant and Version MariaDB 10.3.22

Activity

  1. userjack6880 commented on Feb 21, 2024

    @userjack6880
    Owner

    Have you already installed and ran Open Report Parser (or a similar project) before attempting install of this? Per the Readme:

  2. robbrandt commented on Feb 22, 2024

    @robbrandt

    I just ran into this too. Ubuntu. Open Report Parser installed. The issue is that CREATE VIEW IF NOT EXISTS doesn't seem to be a thing by looking at the MySQL documentation. I changed it to CREATE VIEW (because I knew it didn't exist) and ran install again, and everything worked.

  3. userjack6880 commented on Apr 8, 2024

    @userjack6880
    Owner

    I just ran into this too. Ubuntu. Open Report Parser installed. The issue is that CREATE VIEW IF NOT EXISTS doesn't seem to be a thing by looking at the MySQL documentation. I changed it to CREATE VIEW (because I knew it didn't exist) and ran install again, and everything worked.

    Thanks for pointing this out - this will be reviewed.

  4. MatthewHana commented on Apr 11, 2024

    @MatthewHana

    I just ran into this too. Ubuntu. Open Report Parser installed. The issue is that CREATE VIEW IF NOT EXISTS doesn't seem to be a thing by looking at the MySQL documentation. I changed it to CREATE VIEW (because I knew it didn't exist) and ran install again, and everything worked.

    It looks like your issue is different to OPs. OP is running MariaDB 10.3 which has support for 'IF NOT EXISTS' in 'CREATE VIEW' statements since MariaDB 10.1.3 released in 2015. See https://mariadb.com/kb/en/create-view/ and https://mariadb.com/kb/en/mariadb-10-1-3-release-notes for more info.

    The MySQL v8.0 (and 5.7) documentation doesn't show support for 'IF NOT EXISTS' in 'CREATE VIEW'. See https://dev.mysql.com/doc/refman/8.0/en/create-view.html and https://dev.mysql.com/doc/refman/5.7/en/create-view.html.

    There is shared support for 'OR REPLACE' in 'CREATE VIEW' statements in both MySQL and MariaDB. It could be used as an alternative to 'IF NOT EXISTS' to prevent SQL errors. This will obviously have the effect of overriding the view if it exists, but it should ensure consistency between both variants.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions