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

bpo-40318: Migrate to SQLite3 trace v2 API #19581

Merged
merged 3 commits into from
Sep 5, 2020

Conversation

erlend-aasland
Copy link
Contributor

@erlend-aasland erlend-aasland commented Apr 18, 2020

Use new sqlite3_trace_v2() API if possible.

https://bugs.python.org/issue40318

@erlend-aasland
Copy link
Contributor Author

Ready for review, @berkerpeksag.

@pablogsal pablogsal added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 5, 2020
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by @pablogsal for commit 8980855 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Sep 5, 2020
@erlend-aasland
Copy link
Contributor Author

Thanks for your review, @pablogsal !

@pablogsal
Copy link
Member

@erlend-aasland Seems that sqlite3_enable_shared_cache is also deprecated? Would you like to make another PR (with another issue for this)? You can add me as a reviewer :)

@erlend-aasland
Copy link
Contributor Author

@erlend-aasland Seems that sqlite3_enable_shared_cache is also deprecated? Would you like to make another PR (with another issue for this)? You can add me as a reviewer :)

Sure, I'll have a go at it :)

@pablogsal
Copy link
Member

pablogsal commented Sep 5, 2020

Seems that there is an already opened issue here:
https://bugs.python.org/issue30646

Edit: Check the issue, but seems that there is not much to do, unfortunately, as there is no alternative for that function.

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Sep 5, 2020

Seems that there is an already opened issue here:
https://bugs.python.org/issue30646

Edit: Check the issue, but seems that there is not much to do, unfortunately, as there is no alternative for that function.

I'm not so sure about that. Ref. the SQLite docs:

Note: This method is disabled on MacOS X 10.7 and iOS version 5.0 and will always return SQLITE_MISUSE. On those systems, shared cache mode should be enabled per-database connection via sqlite3_open_v2() with SQLITE_OPEN_SHAREDCACHE.

We could just make sure that db connections are opened with SQLITE_OPEN_SHAREDCACHE if we are on macOS. I'll repost this on the issue.

@pablogsal
Copy link
Member

We could just make sure that db connections are opened with SQLITE_OPEN_SHAREDCACHE if we are on macOS.

Could you mention that in the issue? Ned and Ronald are our MacOS experts so they should weight that

@pablogsal pablogsal merged commit 7f331c8 into python:master Sep 5, 2020
@pablogsal
Copy link
Member

Thanks for your contribution @erlend-aasland !

@erlend-aasland erlend-aasland deleted the fix-issue-40318 branch September 5, 2020 20:47
shihai1991 added a commit to shihai1991/cpython that referenced this pull request Sep 10, 2020
* origin/master: (1373 commits)
  bpo-1635741: Port mashal module to multi-phase init (python#22149)
  bpo-1635741: Port _string module to multi-phase init (pythonGH-22148)
  bpo-1635741: Convert _sha256 types to heap types (pythonGH-22134)
  bpo-1635741: Port the termios to multi-phase init (PEP 489) (pythonGH-22139)
  bpo-41732: add iterator to memoryview (pythonGH-22119)
  bpo-40744: Drop support for SQLite pre 3.7.3 (pythonGH-20909)
  bpo-41316: Make tarfile follow specs for FNAME (pythonGH-21511)
  bpo-41720: Add "return NotImplemented" in turtle.Vec2D.__rmul__(). (pythonGH-22092)
  bpo-1635741 port _curses_panel to multi-phase init (PEP 489) (pythonGH-21986)
  bpo-1635741: Port _overlapped module to multi-phase init (pythonGH-22051)
  bpo-1635741: Port _opcode module to multi-phase init (PEP 489) (pythonGH-22050)
  bpo-1635741 port zlib module to multi-phase init (pythonGH-21995)
  [doc] Add link to Generic in typing (pythonGH-22125)
  bpo-41513: Expand comments and add references for a better understanding (pythonGH-22123)
  bpo-1635741: Port _sha1, _sha512, _md5 to multiphase init (pythonGH-21818)
  closes bpo-41723: Fix an error in the py_compile documentation. (pythonGH-22110)
  [doc] Fix padding in some typing definitions (pythonGH-22114)
  Fix documented Python version for venv --upgrade-deps (pythonGH-22113)
  bpo-40318: Migrate to SQLite3 trace v2 API (pythonGH-19581)
  bpo-41687: Fix sendfile implementation to work with Solaris (python#22040)
  ...
xzy3 pushed a commit to xzy3/cpython that referenced this pull request Oct 18, 2020
@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Nov 2, 2020

@pablogsal: is there any chance to backport this to 3.9 and possibly 3.8? See bpo-42241 and bpo-42242.

SamuelMarks pushed a commit to SamuelMarks/cpython that referenced this pull request Nov 2, 2020
Ref. https://sqlite.org/c3ref/trace_v2.html

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 7f331c8)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
SamuelMarks pushed a commit to SamuelMarks/cpython that referenced this pull request Nov 2, 2020
Ref. https://sqlite.org/c3ref/trace_v2.html

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 7f331c8)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
@pablogsal
Copy link
Member

pablogsal commented Nov 2, 2020

@pablogsal: is there any chance to backport this to 3.9 and possibly 3.8? See bpo-42241 and bpo-42242.

Unfortunately no, as this is nor a bugfix not a security fix :(

@erlend-aasland
Copy link
Contributor Author

erlend-aasland commented Nov 2, 2020

@pablogsal: is there any chance to backport this to 3.9 and possibly 3.8? See [bpo-42241]>
Unfortunately no, as this is not a bugfix not a security fix :(

Got it; thanks :)

@SamuelMarks
Copy link
Contributor

@pablogsal Hmm… but wouldn't fixing compiler warnings constitute a bug fix? 🤔

@pablogsal
Copy link
Member

@pablogsal Hmm… but wouldn't fixing compiler warnings constitute a bug fix? 🤔

Yes, bug this is fixing the warning by opting into a new different API that although unlikely, may have some different behaviour for users while the price of not doing anything is a compiler warning that is not new. That's certainly not worth the risk of backporting 😉

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

Successfully merging this pull request may close these issues.

5 participants