OSDN Git Service

Correct SQL error when changing the default notebook.
authorRandy Baumgarte <randy@fbn.cx>
Tue, 20 Mar 2012 14:51:48 +0000 (10:51 -0400)
committerRandy Baumgarte <randy@fbn.cx>
Tue, 20 Mar 2012 14:51:48 +0000 (10:51 -0400)
src/cx/fbn/nevernote/sql/NotebookTable.java

index 6671a52..5e88726 100644 (file)
@@ -564,7 +564,7 @@ public class NotebookTable {
                query.prepare("Update "+dbName+" set defaultNotebook=false where linked=false");\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error removing default "+dbName+".");\r
                query.prepare("Update "+dbName+" set defaultNotebook=false where linked=false");\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error removing default "+dbName+".");\r
-               query.prepare("Update "+dbName+" set defaultNotebook=true where guid=:guid where linked=false");\r
+               query.prepare("Update "+dbName+" set defaultNotebook=true where guid=:guid and linked=false");\r
                query.bindValue(":guid", guid);\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error setting default "+dbName+".");\r
                query.bindValue(":guid", guid);\r
                if (!query.exec())\r
                        logger.log(logger.EXTREME, "Error setting default "+dbName+".");\r