Hey Guys, I still have this issue with SQLite 3.8.3.1, I could fix my case my changing line
"LastPlayed] = (select case when [UserPlaylist].[LastPlayed] > s.[LastPlayed] then [UserPlaylist].[LastPlayed] else s.[LastPlayed] end from [Song] as s where s.[SongId] = new.[SongId])," to "[LastPlayed] = max( [UserPlaylist].[LastPlayed] , (select s.[LastPlayed] end from [Song] as s where s.[SongId] = new.[SongId]) )" But if you want to debug this issue, some details below: My environment is Windows 8.1 x64 + VS 2012 Update 4 + sqlite-winrt-3080200.vsix from http://sqlite.org/download.html. I did not build sqlite by myself, I'm using official one from downloads. This DropBox folder has VS 2012 project and dump https://www.dropbox.com/sh/o92rrqzqg8i5w5q/WvLuJLkrmb I'm not sure if VS project has all my settings: to get Mixed mode debugging (Managed + Native code) working in VS 2012 for Windows Store apps - you need to open project properties and on Debug tab specify Debugger type = "Mixed (managed and native)". Just try to launch my app and click on Test button. You should get assert in sqlite (this is where I saved debugging session as a dump). This issue can be reproduced only on x86 version of sqlite (at least in my case). Let me know if I can advise somehow to reproduce this problem. -- Thanks, Denis Gladkikh http://outcoldman.com On Wed, Dec 25, 2013 at 12:55 PM, Denis Gladkikh <outcold...@gmail.com>wrote: > Hi All, > > After upgrade from 3.8.1 to 3.8.2 I started to get asserts in debug build > and {"Attempted to read or write protected memory. This is often an > indication that other memory is corrupt."} in Relase when I have x86 app on > amd64 Windows 8.1. These are asserts: > > --------------------------- > Microsoft Visual C++ Runtime Library > --------------------------- > Assertion failed! > > Program: ...Windows\GoogleMusic\bin\x86\Debug\AppX\sqlite3.DLL > File: sqlite3.c > Line: 79461 > > Expression: pExpr->iTable==0 || pExpr->iTable==1 > > For information on how your program can cause an assertion > failure, see the Visual C++ documentation on asserts > > (Press Retry to debug the application - JIT must be enabled) > --------------------------- > Abort Retry Ignore > --------------------------- > > > --------------------------- > Microsoft Visual C++ Runtime Library > --------------------------- > Assertion failed! > > Program: ...Windows\GoogleMusic\bin\x86\Debug\AppX\sqlite3.DLL > File: sqlite3.c > Line: 62181 > > Expression: (&p[1])==pEnd || p[0].db==p[1].db > > For information on how your program can cause an assertion > failure, see the Visual C++ documentation on asserts > > (Press Retry to debug the application - JIT must be enabled) > --------------------------- > Abort Retry Ignore > --------------------------- > > > My environment is: > > SQLite for Windows Runtime (for VS 2012) > > http://visualstudiogallery.msdn.microsoft.com/23f6c55a-4909-4b1f-80b1-25792b11639e > I use my own fork of https://github.com/praeclarum/sqlite-net for > connection. > > I'm on Windows x64, when I'm building amd64 bit app - everything seems > fine, but in case of x86 on Windows 8.1 x64 - I'm getting this error. Did > not have a chance to verify x86 on Win8 x86. > > It looks like that SQLite fails to do insert in one of my tables, which > has following trigger: > > CREATE TRIGGER insert_userplaylistentry AFTER INSERT ON UserPlaylistEntry > BEGIN > > update [UserPlaylist] > set > [SongsCount] = [SongsCount] + 1, > [Duration] = [UserPlaylist].[Duration] + (select s.[Duration] from > [Song] as s where s.[SongId] = new.[SongId]), > [ArtUrl] = case when nullif([UserPlaylist].[ArtUrl], '') is null > then (select s.[AlbumArtUrl] from [Song] as s where s.[SongId] = > new.[SongId]) else [UserPlaylist].[ArtUrl] end, > [LastPlayed] = (select case when [UserPlaylist].[LastPlayed] > > s.[LastPlayed] then [UserPlaylist].[LastPlayed] else s.[LastPlayed] end > from [Song] as s where s.[SongId] = new.[SongId]), > [OfflineSongsCount] = [UserPlaylist].[OfflineSongsCount] + > coalesce( (select 1 from CachedSong cs where new.[SongId] = cs.[SongId]) , > 0), > [OfflineDuration] = [UserPlaylist].[OfflineDuration] + coalesce( > (select s.[Duration] from [Song] as s inner join [CachedSong] as cs on > s.SongId = cs.SongId where s.[SongId] = new.[SongId]), 0) > where [PlaylistId] = new.PlaylistId; > > END; > > > If I remove highlighted rows - insert works. > If somebody is interesting to take deeper look in this problem - I can > send my database. > > Btw, by default all Windows Store applications are x86, so if this is > global issue - it can affect a lot of Windows Store developers. > > -- > Thanks, > Denis Gladkikh > http://outcoldman.com > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users