Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-30 Thread William Candillon
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-30 Thread Chris Hillery
The proposal to merge 
lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into 
lp:zorba/sqlite-module has been updated.

Commit Message changed to:

- New feature detection code added to CMake to be sure that SQLite is able to 
read metadata (fix for Mac OSX)

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-30 Thread Zorba Build Bot
Validation queue starting for merge proposal.
Log at: 
http://zorbatest.lambda.nu:8080/remotequeue/sqlite-check-for-metadata-availability-2013-04-30T18-03-45.308Z/log.html
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-30 Thread Zorba Build Bot
Validation queue job 
sqlite-check-for-metadata-availability-2013-04-30T18-03-45.308Z is finished. 
The final status was:

All tests succeeded!
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-10 Thread Chris Hillery
Review: Approve


-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-10 Thread Chris Hillery
The proposal to merge 
lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into 
lp:zorba/sqlite-module has been updated.

Status: Needs review = Approved

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-04-08 Thread Luis Rodriguez Gonzalez
I think this branch is corrected as Chris suggested. Please re-review.
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp


[Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-01-25 Thread Luis Rodriguez Gonzalez
Luis Rodriguez Gonzalez has proposed merging 
lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into 
lp:zorba/sqlite-module.

Requested reviews:
  Chris Hillery (ceejatec)
Related bugs:
  Bug #1102549 in Zorba: SQLite module doesn't link on MacOS
  https://bugs.launchpad.net/zorba/+bug/1102549

For more details, see:
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041

- New feature detection code added to CMake to be sure that SQLite is able to 
read metadata (fix for Mac OSX)
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.
=== modified file 'cmake_modules/FindSQLite3.cmake'
--- cmake_modules/FindSQLite3.cmake	2012-11-20 16:41:36 +
+++ cmake_modules/FindSQLite3.cmake	2013-01-25 23:35:26 +
@@ -39,8 +39,9 @@
 
   SET(CMAKE_REQUIRED_INCLUDES ${SQLITE_INCLUDE_DIR})
   SET(CMAKE_REQUIRED_LIBRARIES ${SQLITE_LIBRARY})
-#  INCLUDE(CheckFunctionExists)
-#  CHECK_FUNCTION_EXISTS(archive_write_zip_set_compression_deflate #ZORBA_LIBARCHIVE_HAVE_SET_COMPRESSION)
+  
+  INCLUDE(CheckFunctionExists)
+  CHECK_FUNCTION_EXISTS(sqlite3_column_database_name ZORBA_SQLITE_HAVE_METADATA)
 ELSE (SQLITE_INCLUDE_DIR AND SQLITE_LIBRARY)
   SET (SQLITE_FOUND 0)
   SET (SQLITE_LIBRARIES)

=== modified file 'src/config.h.cmake'
--- src/config.h.cmake	2013-01-24 06:17:00 +
+++ src/config.h.cmake	2013-01-25 23:35:26 +
@@ -21,5 +21,6 @@
 #define ZORBA_SQLITE_CONFIG_H
 
 #cmakedefine SQLITE_WITH_FILE_ACCESS
+#cmakedefine ZORBA_SQLITE_HAVE_METADATA
 
 #endif /* ZORBA_SQLITE_CONFIG_H */

=== modified file 'src/sqlite_module.xq'
--- src/sqlite_module.xq	2013-01-24 06:17:00 +
+++ src/sqlite_module.xq	2013-01-25 23:35:26 +
@@ -68,6 +68,8 @@
  :
  : @error s:SQLI0001 if the databse name doesn't exist or it couldn't be opened.
  : @error s:SQLI0007 if there is any unknown option specified.
+ : @error s:SQLI0008 if a non-in-memory database is requested and the module
+ : is built without filesystem access
  : @error s:SQLI if there was an internal error inside SQLite library.
  :)
 declare %an:sequential function s:connect(
@@ -173,6 +175,8 @@
  : @return a object() with the associated the metadata.
  :
  : @error s:SQLI0004 if $pstmnt is not a valid SQLite prepared statement.
+ : @error s:SQLI0009 if no metadata is available (SQLite library compiled without
+ : SQLITE_ENABLE_COLUMN_METADATA).
  : @error s:SQLI if there was an internal error inside SQLite library.
  :)
 declare %an:sequential function s:metadata(

=== modified file 'src/sqlite_module.xq.src/sqlite_module.cpp'
--- src/sqlite_module.xq.src/sqlite_module.cpp	2013-01-24 06:17:00 +
+++ src/sqlite_module.xq.src/sqlite_module.cpp	2013-01-25 23:35:26 +
@@ -573,6 +573,12 @@
   return Only in-memory databases are allowed (Module built without filesystem access);
 }
 #endif /* not SQLITE_WITH_FILE_ACCESS */
+#ifndef ZORBA_SQLITE_HAVE_METADATA
+else if(error == SQLI0009)
+{
+  return Metadata not found (SQLite built without SQLITE_ENABLE_COLUMN_METADATA);
+}
+#endif /* not ZORBA_SQLITE_HAVE_METADATA */
 else if(error == SQLI)
 {
   return Internal error ocurred;
@@ -826,6 +832,7 @@
 int lNotNull, lPrimaryKey, lAutoinc, lRc;
 
 if(theRc == SQLITE_ROW){
+#ifdef ZORBA_SQLITE_HAVE_METADATA
   // Get the metadata for 'theActualColumn' column
   // in a key = value fashion
   lDbHandle = sqlite3_db_handle(theStmt);
@@ -867,6 +874,7 @@
   aKey = theFactory-createString(autoincrement);
   aValue = theFactory-createBoolean((lAutoinc==0)?false:true);
   elements.push_back(std::pairzorba::Item, zorba::Item(aKey, aValue));
+#endif
   aItem = theFactory-createJSONObject(elements);
   elements.clear();
   // Get more data if available
@@ -1068,6 +1076,7 @@
 const zorba::StaticContext* aSctx,
 const zorba::DynamicContext* aDctx) const 
   {
+#ifdef ZORBA_SQLITE_HAVE_METADATA
 sqlite3_stmt *lPstmt;
 zorba::Item lItemPstmt = getOneItem(aArgs, 0);
 zorba::Item lVecItem, lJSONKey, lJSONArray, lJSONRes;
@@ -1101,6 +1110,9 @@
 lJSONRes = lFactory-createJSONObject(lVectorRes);
 
 return ItemSequence_t(new SingletonItemSequence(lJSONRes));
+#else
+throwError(SQLI0008, getErrorMessage(SQLI0008));
+#endif
   }
 
 /***

=== added file 'test/Queries/test3.spec'
--- test/Queries/test3.spec	1970-01-01 00:00:00 +
+++ test/Queries/test3.spec	2013-01-25 23:35:26 +
@@ -0,0 +1,1 @@
+Error: http://www.zorba-xquery.com/modules/sqlite:SQLI0009

=== added file 'test/Queries/test4.spec'
--- test/Queries/test4.spec	1970-01-01 00:00:00 +
+++ test/Queries/test4.spec	2013-01-25 23:35:26 +
@@ -0,0 +1,1 @@
+Error: http://www.zorba-xquery.com/modules/sqlite:SQLI0009

=== added file 

Re: [Zorba-coders] [Merge] lp:~zorba-coders/zorba/sqlite-check-for-metadata-availability into lp:zorba/sqlite-module

2013-01-25 Thread Chris Hillery
Review: Needs Fixing

Unless I'm missing something, it'd be cleaner to avoid the compilation of 
JSONMetadataItemSequence entirely by #ifdef-ing out the class and method 
definitions in the .cpp and .h files. 
-- 
https://code.launchpad.net/~zorba-coders/zorba/sqlite-check-for-metadata-availability/+merge/145041
Your team Zorba Coders is subscribed to branch lp:zorba/sqlite-module.

-- 
Mailing list: https://launchpad.net/~zorba-coders
Post to : zorba-coders@lists.launchpad.net
Unsubscribe : https://launchpad.net/~zorba-coders
More help   : https://help.launchpad.net/ListHelp