Calendar agent - error: sql cached statement NSSQLiteStatement - macos

So after spending quite a lot of time trying to fix my iCalendar app
from the Spinning beach ball lag every time I make a new event or edit an event,
I found this error in the console application:
"error: sql cached statement NSSQLiteStatement <0x7f8eef4c0fd0> on entity 'Group' with sql text 'SELECT t0.Z_ENT, t0.Z_PK, t0.Z_OPT, t0.ZCOLORSTRING, t0.ZISENABLED, ....... ( t0.Z_PK IN (SELECT * FROM _Z_intarray0) AND t0.Z_ENT >= ? AND t0.Z_ENT <= ?) ' failed due to missing variable binding for (null) with expecting bindings (
"<NSSQLBindVariable: 0x7f8eef47bdd0>",
"<NSSQLBindVariable: 0x7f8eef47be70>"
) but actual substitution variables {
objects = "{<NSManagedObject: 0x7f8eef540140> (entity: ExchangePrincipal; id: 0x240092b <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/ExchangePrincipal/p9> ; data: <fault>)}";
}
error: sql cached statement NSSQLiteStatement <0x7f8eef48daa0> on entity 'Attendee' with sql text 'SELECT 0, t0.Z_PK, t0.Z_OPT, t0.ZADDRESSSTRING, t0.ZCOMMONNAME, t0.ZEMAIL, t0.ZINCLUDEDINALLRESPONDED, t0.ZINVITERNAME, t0.ZISSELFINVITED, t0.ZLIKENESSDATASTRING, t0.ZOMITSYNCRECORD, t0.ZPROPOSALENDDATE, t0.ZPROPOSALSTARTDATE, t0.ZPROPOSALSTATUS, t0.ZROLE, t0.ZRSVP, t0.ZSCHEDULEAGENT, t0.ZSCHEDULEFORCESEND, t0.ZSCHEDULESTATUS, t0.ZSTATUS, t0.ZSTATUSMODIFIEDDATE, t0.ZTYPE, t0.ZEVENT, t0.ZMYATTENDEEFOREVENT FROM ZATTENDEE t0 WHERE t0.ZMYATTENDEEFOREVENT IN (SELECT * FROM _Z_intarray0) ' failed due to missing variable binding for (null) with expecting bindings (
) but actual substitution variables {
destinations = "{0x122c009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1163>, 0x1230009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1164>, 0x1234009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1165>, 0x123c009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1167>, 0x1258009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1174>, 0x1264009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1177>, 0x126c009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1179>, 0x127c009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1183>, 0x1280009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1184>, 0x1284009eb <x-coredata://93547915-498F-4251-8E7E-23DD04782C04/Event/p1185>}";
}"
There are around 8-10 of such errors each time I make a new event.
Can you please help me with this issue?
I already reinstalled mac os sierra few times,
but it made no difference.

What fixed it for me was a new clean install of the Mac OS.
Now I don't get the same issue (and Calendar is a pleasure to use),
but if the issue re-appears I will make an update.

Related

Write custom H2 DB function Java

I am trying to run the below code using H2DB (via junit test), while doing so i get error message as below. I understand that, there are no function available as "days" in H2. So i am trying to write a custom function, but it does not work out, can any one help on writing this function.
SQLBuilder class code:
public String dummy() {
return new StringBuilder(new SQL() {
{
SELECT("date(CREATE_TMS)");
SELECT("CASE WHEN date(CREATE_TMS) >= (CURRENT DATE - cast('1' AS integer) days) THEN 'Y' ELSE 'N' END NEW_B");
FROM("Q.DUMMY");
}
}.toString().concat(" FOR READ ONLY WITH UR")).toString();
}
Error message:
org.springframework.jdbc.BadSqlGrammarException:
### Error querying database. Cause: org.h2.jdbc.JdbcSQLSyntaxErrorException: Syntax error in SQL statement "SELECT DATE(CREATE_TMS), CASE WHEN DATE(CREATE_TMS) >= (CURRENT DATE - CAST('1' AS INTEGER) DAYS[*]) THEN 'Y' ELSE 'N' END NEW_BILLING
FROM Q.DUMMY FOR READ ONLY WITH UR "; expected "[, ::, *, /, %, +, -, ||, ~, !~, NOT, LIKE, ILIKE, REGEXP, IS, IN, BETWEEN, AND, OR, ,, )"; SQL statement:
SELECT date(CREATE_TMS), CASE WHEN date(CREATE_TMS) >= (CURRENT DATE - cast('1' AS integer) days) THEN 'Y' ELSE 'N' END NEW_BILLING
FROM Q.DUMMY FOR READ ONLY WITH UR [42001-199]
For some reason days are converted to DAYS[*], we can see that in error message.
Customer method i tried in schema-db2.sql:
drop ALIAS if exists days;
CREATE ALIAS days as '
import java.lang.String;
#CODE
java.lang.String days() throws Exception {
return "days";
}
';
applicaiton.properties:
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=false;Mode=DB2
DAYS is not a function and is not a something that other databases support. Db2 also uses non-standard interval literals.
If you can build H2 from its current sources, you can use cast('1' AS integer) day in it (not the days) and such construction is also supported by Db2. You can also simply use 1 DAY, it is supported by current H2 and Db2 too.
(CURRENT_DAY - 1 DAY)
Sources of H2 are available on GitHub:
https://github.com/h2database/h2database
Building instructions are here:
https://h2database.com/html/build.html#building
You need a jar target.
To compile H2 from the current sources you need JDK 8, 9, 10, 11, or 12. Compiled jar will be compatible with more recent versions.

"Commands out of sync" error when trying to execute a procedure in MySQL 8

When executing below code in phpMyAdmin:
use db;
DELIMITER $$
DROP PROCEDURE IF EXISTS McaTest3$$
CREATE PROCEDURE McaTest3()
BEGIN
SELECT
cl.*
FROM `condition_library` cl
LEFT JOIN condition_custom cc on cl.condition_library_id = cc.condition_library_id
and cc.active = 1
AND (cc.permit_application_id = 20231 OR cc.permit_id = NULL)
WHERE FIND_IN_SET(cl.`condition_library_id`, '13070')
AND cl.active = 1
and cc.condition_library_id IS NULL;
END$$
DELIMITER ;
call McaTest3();
Getting error:
Error
Static analysis:
1 errors were found during analysis.
Missing expression. (near "ON" at position 25)
SQL query: Edit Edit
SET FOREIGN_KEY_CHECKS = ON;
MySQL said: Documentation
#2014 - Commands out of sync; you can't run this command now
This happens when there is no record found in the table which is at LEFT JOIN.
When the same is ran in MySQL Workbench: NO ERROR and return empty dataset.
Same procedure when executed from Application (Appian) is failing as well… Any clues?
Another question on Stackoverflow answered my issue:
link: MySQL error #2014 - Commands out of sync; you can't run this command now

sqlite select request does not fetch moz_place

I am trying to fetch historics data of the day and to print it.
the error i am getting is :
sqlite3 : Operational error near "(" : syntax error
import sqlite3 as sqlite
import sys
import time
conn = sqlite.connect('places.sqlite.db')
c = conn.cursor()
today = str(time.time())
here i am selecting the 10 first caracter because i want to search for a unix epoch match in seconds and not in milliseconds ( so only the first 10 are interesting to me)
c.execute("SELECT * FROM moz_places WHERE LEFT(last_visit_date, 10)='"+today+"'")
user1 = c.fetchone()
print(user1)
As mentionned earlier, i get "sqlite3 : Operational error near "(" : syntax error"
Do you what is wrong there ?
Here is how to convert moz_places.last_update_time into a string, 'YYYY-MM-DD HH:MM:SS':
UTC: datetime(last_visit_date/1000000, 'unixepoch')
Local time zone: datetime(last_visit_date/1000000, 'unixepoch','localtime')
Here is a link to SQLite doc on Date and Time Functions.
The today string created in python should match format exactly (because it will be doing a string comparison).
From the comments: the name of the places database in Firefox is places.sqlite (not places.sqlite.db). The database name should include full or relative path if it is not in your current working directory.

Compile Issue under ProCOBOL due to SQLBEX

Have been trying to compile an existing Pro*COBOL program after making few changes, have verified the syntax and Non-Printable character which may cause issue for compilation.
But at the end, compilation for Pro*COBOL failing due one of .(dot) appearing under CALL to SQLBEX for the embedded SQL (Line Number 18106 under the listing).
See below code for more details, code snippet has been taken from Pro*COBOL code and the listing generated during compilation.
For other instances where SQLBEX is being called, the .(dot) doesn't appear. Would really appreciate any help.
Code under the listing:
18085 IF SQLCODE IN SQLCA = WS-DEADLOCK-WAIT-FOR-RESRC 26825000
18086 SET DEADLOCK TO TRUE 26826000
18087
18088* EXEC SQL 26827000
18089* COMMIT 26828000
18090* END-EXEC
18091 MOVE 1 TO SQL-ITERS
18092 MOVE 2914 TO SQL-OFFSET
* Micro Focus COBOL for UNIX V4.0 revision 004 18-Jan-17 07:31 Page 313
* cmcomc23.cob
18093 MOVE 0 TO SQL-OCCURS
18094 CALL "SQLADR" USING
18095 SQLCUD
18096 SQL-CUD
18097 CALL "SQLADR" USING
18098 SQLCA
18099 SQL-SQLEST
18100 MOVE 256 TO SQL-SQLETY
18101
18102 CALL "SQLBEX" USING
18103 SQLCTX
18104 SQLEXD
18105 SQLFPN
18106 .
18107 26829000
18108 DISPLAY 'DEAD LOCK OCCURED ' 26829100
18109 GO TO 9000-EXIT 26829200
18110 ELSE 26829300
* 562-S****************************************************************( 308)**
** An "ELSE" phrase did not have a matching IF and was discarded.
18111 SET NO-DEADLOCK TO TRUE 26829400
18112 END-IF. 26829500
* 564-S********** ( 313)**
** A scope-delimiter did not have a matching verb and was discarded.
Original Code under Program:
268210******************************************************************26821000
268221 9000-SQL-ERROR SECTION. 26822100
268230******************************************************************26823000
268250 EXEC SQL 26824000
268250 WHENEVER SQLERROR CONTINUE 26824000
268250 END-EXEC. 26824000
268240 26824000
268250 IF SQLCODE IN SQLCA = WS-DEADLOCK-WAIT-FOR-RESRC 26825000
268260 SET DEADLOCK TO TRUE 26826000
268270 EXEC SQL 26827000
268280 COMMIT 26828000
268290 END-EXEC 26829000
268291 DISPLAY 'DEAD LOCK OCCURED ' 26829100
268292 GO TO 9000-EXIT 26829200
268293 ELSE 26829300
268294 SET NO-DEADLOCK TO TRUE 26829400
268295 END-IF. 26829500
268296 26829600
268297 MOVE 'E' TO WS-ERR-SEVERITY-CD. 26829700

Test the existence of a Teradata table and create the table if non-existent

Our Continuous Inegration server (Hudosn) is having a strange issue when attempting to run a simple create table statement in Teradata.
This statement tests the existence of the max_call table:
unless $teradata_connection.table_exists? :arm_custom_db__max_call_attempt_parameters
$teradata_connection.run('CREATE TABLE all_wkscratchpad_db.max_call_attempt_parameters AS (SELECT * FROM arm_custom_db.max_call_attempt_parameters ) WITH NO DATA')
end
The table_exists? method does the following:
def table_exists?(name)
v ||= false # only retry once
sch, table_name = schema_and_table(name)
name = SQL::QualifiedIdentifier.new(sch, table_name) if sch
from(name).first
true
rescue DatabaseError => e
if e.to_s =~ /Operation not allowed for reason code "7" on table/ && v == false
# table probably needs reorg
reorg(name)
v = true
retry
end
false
end
So as per the from(name).first line, the test which this method is performing is just a simple select statement, which, in SQL, looks like: SELECT TOP 1 MAX(CAST(MAX_CALL_ATTEMPT_CNT AS BIGINT)) FROM ALL_WKSCRATCHPAD_DB.MAX_CALL_ATTEMPT_PARAMETERS
The above SQL statement executes perfectly fine within Teradata SQL Assistant, so it's not a SQL syntax issue. The generic ID which our testing suite (Rubymine) uses is also not the issue; that ID has select access to the arm_custom_db.
The exeption which I can see is being thrown (within the builds console output on Hudson) is
Sequel::DatabaseError: Java::ComTeradataJdbcJdbc_4Util::JDBCException. Since this execption is a subclass of DatabaseError, the exception shouldn't be the problem either.
Also: We use unless statements like this every day for hundreds of different tables, and all except this one work correctly. This statement just seems to be a problem.
The complete error message which appears in the builds console output of Hudson is as follows:
[2015-01-07T13:56:37.947000 #16702] ERROR -- : Java::ComTeradataJdbcJdbc_4Util::JDBCException: [Teradata Database] [TeraJDBC 13.10.00.17] [Error 3807] [SQLState 42S02] Object 'ALL_WKSCRATCHPAD_DB.MAX_CALL_ATTEMPT_PARAMETERS' does not exist.: SELECT TOP 1 MAX(CAST(MAX_CALL_ATTEMPT_CNT AS BIGINT)) FROM ALL_WKSCRATCHPAD_DB.MAX_CALL_ATTEMPT_PARAMETERS
Sequel::DatabaseError: Java::ComTeradataJdbcJdbc_4Util::JDBCException: [Teradata Database] [TeraJDBC 13.10.00.17] [Error 3807] [SQLState 42S02] Object 'ALL_WKSCRATCHPAD_DB.MAX_CALL_ATTEMPT_PARAMETERS' does not exist.
I don't understand why this specific bit of code is giving me issues...there does not appear to be anything special about this table or database, and all SQL code executes perfectly fine in Teradata when I am signed in with the same exact user ID that is being used to execute the code from Hudson.

Resources