Coder Social home page Coder Social logo

Comments (3)

volkov-am avatar volkov-am commented on June 20, 2024 3

The problem raised with sqlite >= 3.25.0

Starting with sqlite-3.25.0 ALTER TABLE ... RENAME TO ... also rename dependent views

From sqlite Changelog:

2018-09-15 (3.25.0)
2.b. Fix table rename feature so that it also updates references to the renamed table in triggers and views.
https://sqlite.org/changes.html#version_3_25_0

Openvas migrate code:

migrate_172_to_173()
"ALTER TABLE nvts RENAME TO nvts_172;"
...
"DROP TABLE nvts_172;"

It works well with older sqlite versions but it breaks results_autofp view with recent sqlite

Workaround:
recreate results_autofp view with correct table name reference:

(echo "DROP VIEW results_autofp;"; sqlite3 /var/lib/openvas/mgr/tasks.db '.schema results_autofp' | sed 's/nvts_172/nvts/g') | sqlite3 /var/lib/openvas/mgr/tasks.db

from gvmd.

olafweiler avatar olafweiler commented on June 20, 2024

Built latest stable version from source (e.g. latest OpenVAS Manager 7.0.3, etc.).
--> Migration works fine there.

Not sure, what's wrong with the Debian binary distribution.
--> Issue can be closed.

from gvmd.

metersales avatar metersales commented on June 20, 2024

The problem raised with sqlite >= 3.25.0

Starting with sqlite-3.25.0 ALTER TABLE ... RENAME TO ... also rename dependent views

From sqlite Changelog:

2018-09-15 (3.25.0)
2.b. Fix table rename feature so that it also updates references to the renamed table in triggers and views.
https://sqlite.org/changes.html#version_3_25_0

Openvas migrate code:

migrate_172_to_173()
"ALTER TABLE nvts RENAME TO nvts_172;"
...
"DROP TABLE nvts_172;"

It works well with older sqlite versions but it breaks results_autofp view with recent sqlite

Workaround:
recreate results_autofp view with correct table name reference:

(echo "DROP VIEW results_autofp;"; sqlite3 /var/lib/openvas/mgr/tasks.db '.schema results_autofp' | sed 's/nvts_172/nvts/g') | sqlite3 /var/lib/openvas/mgr/tasks.db

Perhaps I'm just a total newb, but how do I use the workaround? Is this to be used in bash or after logging in to sqlite3 or somewhere else? I'm having this problem in Ubuntu 20.04. I just upgraded from 18.04. I tried removing the package and reinstalling, but that didn't help. This seems to be the only answer available to me. I would appreciate any help you might offer.

from gvmd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.