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

Materialized View recreation during Fix Model adds extra semi-colon (Upgrading from 1.0.5 to 1.1.1) #1864

Closed
dtw-dnorman opened this issue Mar 14, 2024 · 2 comments
Milestone

Comments

@dtw-dnorman
Copy link

Bug description
When using Fix Model the source of Materialized Views get an extra semi-colon at the end. And then another extra semi-colon appears when you view the Source.

How to reproduce
When opening our model from 1.0.5 in 1.1.1 we got some XML errors so I used the Fix Model button.

Expected behavior
No changes to the SQL definition of Materialized Views.

Screenshots
If applicable, add screenshots to help explain your problem.

Info about your desktop

  • OS: Windows 10 Pro
  • Version: 22H2
  • Window manager:
  • pgModeler version: 1.1.1 20240314.20240314
  • Qt version: 6.6.2

Stacktrace / Debug info
The crash happened before noticing the bug, but I'm not sure this specific crash is related to it happening or if any use of Fix Model would reproduce the effect.


[0] src/mainwindow.cpp (2101)
  void MainWindow::showFixMessage(Exception&, const QString&)
    [ModelFileNotLoaded] Could not load the database model file `U:/PG Models/pg_web-v15.1.dbm'. Check the error stack to see details. Try to run `pgmodeler-cli --fix-model' in order to correct the structure of the file if that is the case.

[1] src/mainwindow.cpp (1300)
  void MainWindow::addModel(const QString&)
    [InvModelFileNotLoaded] Could not load file `U:/PG Models/pg_web-v15.1.dbm'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing!

[2] src/mainwindow.cpp (1274)
  void MainWindow::addModel(const QString&)
    [InvModelFileNotLoaded] Could not load file `U:/PG Models/pg_web-v15.1.dbm'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing!

[3] src/widgets/modelwidget.cpp (1822)
  void ModelWidget::loadModel(const QString&)
    [InvModelFileNotLoaded] Could not load file `U:/PG Models/pg_web-v15.1.dbm'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing!

[4] src/databasemodel.cpp (3588)
  void DatabaseModel::loadModel(const QString&)
    [InvModelFileNotLoaded] Could not load file `U:/PG Models/pg_web-v15.1.dbm'. The same appears to be inconsistent or one of its dependencies (DTD files) has errors or is missing!

[5] src/xmlparser.cpp (84)
  void XmlParser::loadXMLFile(const QString&)
    [LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Element view content does not follow the DTD, expecting (schema , role? , tablespace? , comment? , tag? , appended-sql? , prepended-sql? , position , reference* , simplecol* , definition), got (schema role position reference) . 
       ** U:/PG Models/pg_web-v15.1.dbm

[6] src/xmlparser.cpp (115)
  void XmlParser::loadXMLBuffer(const QString&)
    [LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Element view content does not follow the DTD, expecting (schema , role? , tablespace? , comment? , tag? , appended-sql? , prepended-sql? , position , reference* , simplecol* , definition), got (schema role position reference) . 

[7] src/xmlparser.cpp (188)
  void XmlParser::readBuffer()
    [LibXMLError] Error while interpreting XML buffer at line 0 column 0.
Message generated by the parser: Element view content does not follow the DTD, expecting (schema , role? , tablespace? , comment? , tag? , appended-sql? , prepended-sql? , position , reference* , simplecol* , definition), got (schema role position reference) . 

Additional info
I only happened to find this because I diffed the two models in a text editor to see what was changed in the fixed model.

@rkhaotix
Copy link
Member

Hi @dtw-dnorman

Could you please provide a copy of the model created on 1.0.5 so I can debug the fix process?

Thanks

@dtw-dnorman
Copy link
Author

@rkhaotix Sent via email!

@rkhaotix rkhaotix added this to the 1.1.0 milestone Mar 15, 2024
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