SQLite Forum

Timeline
Login

7 forum posts by user kyle

2021-06-18
16:43 Reply: website: Wapp Application Error (artifact: e48a8e4fb4 user: kyle)

Looks good to me...

03:21 Post: website: Wapp Application Error (artifact: 8fb639b5ad user: kyle)

I accidentally typed a trailing \ in the search bar on sqlite.org, and it resulted in a Wapp Application Error:

https://www.sqlite.org/search?s=d&q=x%5C

2020-06-11
22:32 Reply: DROP VIEW IF EXISTS failure (artifact: 8fa4c468a7 user: kyle)

I'm not sure I do think that, I was just trying to (maybe) clarify the question. If it's strictly a name issue, what should this do:

% ./sqlite3
SQLite version 3.33.0 2020-06-11 16:04:10
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE t1(x);
sqlite> DROP INDEX IF EXISTS t1;
sqlite>

I'm not sure what it should do, but it doesn't report an error. The docs for DROP INDEX don't explicitly mention the IF EXISTS clause, so I can't say what I expect it to do.

21:54 Reply: DROP VIEW IF EXISTS failure (artifact: f4242d51a3 user: kyle)

The full line in the DROP VIEW documentation says:

If the specified view cannot be found and the IF EXISTS clause is not present, it is an error. If the specified view cannot be found and an IF EXISTS clause is present in the DROP VIEW statement, then the statement is a no-op. 

which implies (no guarantee) it doesn't return an error.

On the other side, the DROP TABLE docs say:

The optional IF EXISTS clause suppresses the error that would normally result if the table does not exist.

It says nothing about views, so there may be an issue (documentation or otherwise) if we try with drop table:

% ./sqlite3
SQLite version 3.33.0 2020-06-11 16:04:10
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE t1(x);
sqlite> CREATE VIEW v1 AS SELECT * FROM t1;
sqlite> DROP TABLE IF EXISTS v1;
Error: use DROP VIEW to delete view v1
sqlite>

Perhaps a note in the documentation wouldn't hurt to clarify this edge case?

21:24 Reply: DROP VIEW IF EXISTS failure (artifact: d1fcf3295e user: kyle)

Perhaps another way to phrase the question: Why do these two DROP statements behave differently?

% ./sqlite3
SQLite version 3.33.0 2020-06-11 16:04:10
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE t1(x);
sqlite> DROP VIEW IF EXISTS v1;
sqlite> DROP VIEW IF EXISTS t1;
Error: use DROP TABLE to delete table t1
sqlite>

Neither VIEW exists, but the behavior is different. I think the OP expects no error in either case.

2020-05-25
21:09 Reply: warning: function may return address of local variable -Wreturn-local-addr (artifact: d0fed2aac0 user: kyle)

CGo isn't the compiler for the c code in this case, just a wrapper for CC, which is gcc in Adam's case. I've tried to replicate the warning with a few gcc versions and the amalgamation, but cannot.

17:11 Reply: warning: function may return address of local variable -Wreturn-local-addr (artifact: 595648eba3 user: kyle)

Adam, can you give some more information on what compiler cgo is using and which flags? I couldn't reproduce on my local machine. The full output of go env would help.