Re: [sqlite] SQLite does not support ARM platform?

2017-03-20 Thread Hugo Beauzée-Luyssen


> On 20 Mar 2017, at 23:17, Jaime Stuardo  wrote:
> 
> Thanks all who answered.
> 
> Yes... it seems a MSVC limitation, however, it is very strange. I am using 
> Visual Studio 2008 which does support ARM compilation.  I did that, adding 
> some compiler switches for target WIN32_CE but I got million of warnings, of 
> this type:
> 
> sqlite3.c(166) : warning C4005: 'OS_VXWORKS' : macro redefinition
>sqlite3.c(158) : see previous definition of 'OS_VXWORKS'
> sqlite3.c(216) : warning C4005: 'GCC_VERSION' : macro redefinition
>sqlite3.c(214) : see previous definition of 'GCC_VERSION'
> sqlite3.c(222) : warning C4005: 'CLANG_VERSION' : macro redefinition
>sqlite3.c(220) : see previous definition of 'CLANG_VERSION'
> sqlite3.c(227) : warning C4005: 'MSVC_VERSION' : macro redefinition
>sqlite3.c(225) : see previous definition of 'MSVC_VERSION'
> sqlite3.c(10924) : warning C4005: 'SQLITE_DEFAULT_PAGE_SIZE' : macro 
> redefinition
>sqlite3.c(10920) : see previous definition of 
> 'SQLITE_DEFAULT_PAGE_SIZE'
> sqlite3.c(10939) : warning C4005: 'SQLITE_MAX_DEFAULT_PAGE_SIZE' : macro 
> redefinition
>sqlite3.c(10935) : see previous definition of 
> 'SQLITE_MAX_DEFAULT_PAGE_SIZE'
> sqlite3.c(11015) : warning C4005: 'SQLITE_INT_TO_PTR' : macro redefinition
>sqlite3.c(11012) : see previous definition of 'SQLITE_INT_TO_PTR'
> sqlite3.c(11016) : warning C4005: 'SQLITE_PTR_TO_INT' : macro redefinition
>sqlite3.c(11013) : see previous definition of 'SQLITE_PTR_TO_INT'
> sqlite3.c(11018) : warning C4005: 'SQLITE_INT_TO_PTR' : macro redefinition
>sqlite3.c(11015) : see previous definition of 'SQLITE_INT_TO_PTR'
> sqlite3.c(11019) : warning C4005: 'SQLITE_PTR_TO_INT' : macro redefinition
>sqlite3.c(11016) : see previous definition of 'SQLITE_PTR_TO_INT'
> sqlite3.c(11021) : warning C4005: 'SQLITE_INT_TO_PTR' : macro redefinition
> 
> I need to compile this for Windows Mobile ARM device. Is there another way to 
> do it by mean of other compiler that works in Windows? I need to use Windows 
> since the output file should be a DLL.
> 

Given that Windows for ARM was released around 2013 (if I remember correctly), 
I doubt that MSVC2008 will do. Sadly, GCC doesn’t support ARM for Windows as a 
target, and clang is on the way, but wasn’t ready yet last time I checked.
That being said, Windows for ARM/Windows RT doesn’t support “Desktop 
applications”. Is there any reason why need to have a DLL, and not the prebuilt 
package? I’d understand the need for native code, but then I’m not sure you can 
do that with anything earlier than Visual Studio 2013

> By opening sqlite3.c I found directives such as this:
> 
> if defined(_MSC_VER) && _MSC_VER>=1400
> 
> 
> That suggests me that the code is prepared for MSVC also, but it is not 
> actually.
> 
> 
> Does somebody have experience compiling this in MSVC?
> 
> Regards
> Jaime


___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] SQLite does not support ARM platform?

2017-03-20 Thread Hugo Beauzée-Luyssen
Hi,

> On 20 Mar 2017, at 22:24, Jaime Stuardo  wrote:
> 
> Hello,
> 
> I have finally given up. After almost all day trying to compile SQLite 
> amalgamated source code files for ARM platform I got the conclusion that 
> SQLite is not for ARM platform, even when documentation says the contrary. I 
> have VS 2008 and I tried to compile some C++ wrappers out there that contains 
> amalgamated files but with no success
> 

sqlite totally supports ARM, we use it & build it ourselves for VLC on android, 
and even the android SDK provides a way to use sqlite IIRC.

> I tried several command line parameters, but nothing.
> 
> Last try was, by using only amalgamated files (shell.c, sqlite3.c, sqlite3.h, 
> sqlite3ext.h). There is no science with this. I open a VS2008 command prompt 
> and VS2012 ARM Command prompt and compile with:
> 
> "cl sqlite3.c -link -dll -out:sqlite3.dll -machine:ARM"
> 
> In both cases, I got this error:
> 
> "crtdefs.h(338) : fatal error C1189: #error :  Compiling Desktop applications 
> for the ARM platform is not supported.”
> 

Seems that you’re trying to compile sqlite for an ARM application without 
settings the proper flags to point MSVC at a store application.
Either you’re building for a store app, and you should be able to use some 
prebuild version (https://www.sqlite.org/2017/sqlite-uwp-317.vsix) or 
you’re building for a desktop app, and there is no desktop apps on 
WindowsRT/Windows for ARM.

> That took  me to the conclusion about SQLite is only for Desktop 
> applications, which is very bad. Is there another alternative or trick to 
> make it compile for ARM platform?
> 

Don’t know about windows, but using the algamated version and autotools, it 
should be as easy as ./configure —host= && make

> Thanks
> Jaime
> 
> ___
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] last_insert_rowid and FTS in 3.17

2017-03-16 Thread Hugo Beauzée-Luyssen
On Thu, Mar 16, 2017, at 03:25 AM, Keith Medcalf wrote:
> 
> Head of trunk certainly fixes it ...
> 
> SQLite version 3.18.0 2017-03-15 19:11:29
> Enter ".help" for usage hints.
> Connected to a transient in-memory database.
> Use ".open FILENAME" to reopen on a persistent database.
> sqlite> select sqlite_source_id();
> 2017-03-15 19:11:29
> b1b1aa8b69aa80c83aec3380565f0b4ec0b6a6e033537becee098872da362e9a
> sqlite> CREATE TABLE IF NOT EXISTS Foo(
>...> id_foo INTEGER PRIMARY KEY AUTOINCREMENT,
>...> bar TEXT
>...> );
> sqlite>
> sqlite> CREATE VIRTUAL TABLE IF NOT EXISTS FooFts
>...> USING FTS4(bar);
> sqlite>
> sqlite> CREATE TRIGGER IF NOT EXISTS insert_fts
>...> AFTER INSERT ON Foo
>...> WHEN new.bar IS NOT NULL
>...> BEGIN
>...> INSERT INTO FooFts(rowid, bar) VALUES(new.id_foo,
>new.bar);
>...> END;
> sqlite>
> sqlite>
> sqlite> BEGIN;
> sqlite> INSERT INTO Foo(id_foo) VALUES(NULL);
> sqlite> SELECT last_insert_rowid();
> 1
> sqlite> INSERT INTO Foo(id_foo) VALUES(NULL);
> sqlite> SELECT last_insert_rowid();
> 2
> sqlite> COMMIT;
> sqlite> SELECT last_insert_rowid();
> 2
> sqlite>
> sqlite> BEGIN;
> sqlite> INSERT INTO Foo(id_foo, bar) VALUES(NULL, "otter");
> sqlite> COMMIT;
> sqlite> SELECT last_insert_rowid();
> 3
> sqlite>
> sqlite> SELECT * FROM sqlite_sequence;
> Foo|3
> sqlite>
> sqlite>
> 
> > -----Original Message-----
> > From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
> > On Behalf Of Richard Hipp
> > Sent: Wednesday, 15 March, 2017 18:01
> > To: SQLite mailing list
> > Subject: Re: [sqlite] last_insert_rowid and FTS in 3.17
> > 
> > On 3/15/17, Hugo Beauzée-Luyssen <h...@beauzee.fr> wrote:
> > > Hi, I'm having some issues with last_insert_rowid starting with 3.17
> > > Basically it seems to be returning the row inserted by a trigger,
> > > instead of the explicitly inserted row.
> > 
> > Please try the latest pre-release snapshot at
> > https://www.sqlite.org/download.html and let us know whether or not it
> > fixes your problem.
> > --
> > D. Richard Hipp
> > d...@sqlite.org
> > ___

Indeed it does fix it!
Do you have a rough estimate on a 3.17.1 or 3.18 release?

Thanks a lot,

-- 
  Hugo Beauzée-Luyssen
  h...@beauzee.fr
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] last_insert_rowid and FTS in 3.17

2017-03-15 Thread Hugo Beauzée-Luyssen
Hi,


Hi, I'm having some issues with last_insert_rowid starting with 3.17
Basically it seems to be returning the row inserted by a trigger,
instead of the explicitly inserted row.
As far as I understand, this contradicts the last_insert_rowid()
documentation.

I wrote a small test case to demonstrate the issue:

chouquette@nibbler cat /tmp/test.sql
CREATE TABLE IF NOT EXISTS Foo(
id_foo INTEGER PRIMARY KEY AUTOINCREMENT,
bar TEXT
);

CREATE VIRTUAL TABLE IF NOT EXISTS FooFts
USING FTS4(bar);

CREATE TRIGGER IF NOT EXISTS insert_fts
AFTER INSERT ON Foo
WHEN new.bar IS NOT NULL
BEGIN
INSERT INTO FooFts(rowid, bar) VALUES(new.id_foo, new.bar);
END;


BEGIN;
INSERT INTO Foo(id_foo) VALUES(NULL);
SELECT last_insert_rowid();
INSERT INTO Foo(id_foo) VALUES(NULL);
SELECT last_insert_rowid();
COMMIT;
SELECT last_insert_rowid();

BEGIN;
INSERT INTO Foo(id_foo, bar) VALUES(NULL, "otter");
COMMIT;
SELECT last_insert_rowid();

SELECT * FROM sqlite_sequence;

chouquette@nibbler ./sqlite3 --version
3.16.2 2017-01-06 16:32:41 a65a62893ca8319e89e48b8a38cf8a59c69a8209
chouquette@nibbler ./sqlite3 < /tmp/test.sql
1
2
2
3
Foo|3

chouquette@nibbler ~/dev/prefix/bin/sqlite3 --version
3.17.0 2017-02-13 16:02:40 ada05cfa86ad7f5645450ac7a2a21c9aa6e57d2c
chouquette@nibbler ~/dev/prefix/bin/sqlite3 < /tmp/test.sql
1
2
2
1
Foo|3

Has the behavior changed without being documented (or did I miss the
change?), or is this indeed a bug?

Thanks a lot in advance,

Regards,


-- 
  Hugo Beauzée-Luyssen
  h...@beauzee.fr
___
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users