SQL query not working: SQL logic error
(1) By someone on 2024-12-01 07:28:47 [source]
I have the following SQL statement that does work (for the most part) in DB Browser for SQLite (the graphical app), but will not work in the SQLite shell, nor my library. My query: WITH magnifier(idx) AS ( VALUES (1), (2) ) SELECT COALESCE(f.fname, p.path) AS Path, COALESCE(f.inode, '') AS Inode, COALESCE(f.fsize, '') AS Size, COALESCE(f.uid, '') AS UID, COALESCE(f.atime, '') AS atime, COALESCE(f.mtime, '') AS mtime, COALESCE(f.ctime, '') AS ctime, COALESCE(f.type, '') AS Type FROM Paths p CROSS JOIN magnifier m LEFT JOIN Files f ON m.idx = 2 AND f.pathid = p.pathid ORDER BY p.path, m.idx, f.fname, f.inode, f.fsize, f.uid, f.atime, f.mtime, f.ctime, f.type; My create tables statements (sorry for the double quotes, but I don't have time to remove them): #define SET_DB_TBLS_SQL "CREATE TABLE Paths (pathid INTEGER PRIMARY KEY NOT NULL, "\ "path TEXT NOT NULL UNIQUE ON CONFLICT IGNORE, "\ "uid INTEGER NOT NULL, "\ "atime INTEGER, "\ "mtime INTEGER, "\ "ctime INTEGER);"\ "CREATE TABLE Files ("\ "fileid INTEGER PRIMARY KEY NOT NULL, "\ "pathid INTEGER NOT NULL "\ "REFERENCES Paths(pathid) "\ "ON DELETE CASCADE "\ "ON UPDATE CASCADE, "\ "fname TEXT, "\ "inode INTEGER NOT NULL, "\ "fsize INTEGER NOT NULL, "\ "uid INTEGER NOT NULL, "\ "atime INTEGER, "\ "mtime INTEGER, "\ "ctime INTEGER, "\ "type TEXT "\ "CONSTRAINT fi_fname_not_null NOT NULL "\ "CONSTRAINT fi_fname_not_empt CHECK (fname > ''));" The goal is that each path record is only selected ONCE, not multiple times if there are multiple file records associated with said path record. I'm not interested in a "different" solution unless it's a lot simpler, and ONLY if it's a lot simpler. Therefore any comments that are not *directly* relevant to my question is off-topic and will have to be ignored. I'm not trying to be difficult, but I'm a visual learner and *need* to be able to SEE it. So please, be very clear is any answers given and please, if you give an example, it needs to be *complete* and include ALL table fields stated in my first SQL query above, not just the file name and size. When I run the above query in my library, I get the following error message from the sqlite library: SQL logic error But again, it does work for the most part in the DB Browser for SQLite and it does return the relevant records. The other issue I've noticed is that if there is only one path record, it does not work at all, and at most I might just get the path itself and that's about it. I do not understand why it's working in DB Browser for SQLite (for the most part, once again), but will not work in either the SQLite shell or when I try to use it in my library. It does not make any sense to me. So my questions are: 1) Why is the same SQL statement working in DB Browser for SQLite, but nowhere else, and most importantly, how exactly do I fix it? 2) Why is the same SQL statement not giving much if any result where there is only one path record? Again, and I must insist that anything outside of those two questions that has no direct relevance to those same two questions is off-topic. If there is some other info needed to answer my questions, then please clearly state what that info is and why it's needed. Thank you in advance.
(2.1) By Chris Locke (chrisjlocke1) on 2024-12-01 13:48:30 edited from 2.0 in reply to 1 [link] [source]
Can you define what 'but will not work in the SQLite shell' means. Does it return an error? Not return the number of rows you expect? Blow up your neighbours house?
The other issue I've noticed is that if there is only one path record, it does not work at all
It would be better to add example records, so that you can demonstrate with record A, B and C, it should return result D, but your query is returning result E .. at the moment, I have no idea what you're trying to achieve, or what data to add to the tables to make it fail.
(3) By someone on 2024-12-02 05:53:24 in reply to 2.1 [link] [source]
Yes, it returns an error that I believe says something to the effect of "SQL Error: near 'WITH': Syntax error", in any case it's not the same error coming from the sqlite library itself (and as reported by sqlite3_errstr()). And while depending on which neighbor you're talking about, I wish, but no it doesn't "blow" anything up. It doesn't matter if the data is just fake/example data or not, I still get the same result either way. Well, I have actually explained what I'm trying to achieve in my very first post. And I do not know how else I can explain it, nor why some don't seem to be able to understand it, it's really baffling to me how it's so unclear to some. I'm sorry, but I've answered your questions, I've provided the create table statements, the fields each table has, the data types for those same fields, along with my query exactly as it was when I got the error messages, along with the actual error messages I'm getting. Surely, I've provided enough info for someone who knows a lot more than I about databases and SQL to be able to tell me exactly where I've gone wrong and exactly what code I need instead. Surely I have done that, particularly when I've seen other questions on other forums where less info was provided, but somebody who knew enough was still able to answer it and provide a solution. So if you want to test my query, then go right ahead and use whatever data you darn well like and do whatever tests you want/need to do. I'm sorry, but if I was able to solve this myself, I wouldn't be here asking in the first place. Clearly I can't, that's why I'm here asking. So with all respect, can I please just get some actual answers now that I can understand, so I can move forward? As I cannot move forward unless someone can show me exactly where I've gone wrong, and/or exactly what it is I'm missing here in terms of the actual code, because there must be something wrong somewhere, there must be. Of course it would very much help a great deal if the error messages actually told me exactly what it's taking issue with, rather than some pointless message that tells me absolutely nothing apart of the obvious... not to mention documentation that is actually understandable to someone who isn't a world-renowned expert in databases, SQL, and/or C...
(4) By Gunter Hick (gunter_hick) on 2024-12-02 06:36:34 in reply to 3 [link] [source]
Your very verbose posts contain only marginal information and some threats. Most probably YOU have neglected to verify that your copy of DB Browser for SQLite (IIRC a third party product) and your SQLite shell/library are indeed running the same release of SQLite; this would easily explain why the former does and the latter does not support "WITH". It is also YOUR responsibility to provide sufficient information for others to easily reproduce your alleged problem. This includes the data required to reproduce it, the excpected results and the actual results. And maybe an explanation of why your expectations are more correct than the results. Being belligerent is not going to improve the quality of answers provided - indeed I was very tempted to just ignore your temper tantrum. Feel free to ignore this last remark, which is very pertinent to "how to get good answers" but which you will undoubtedly regard as "off topic".
(6) By someone on 2024-12-02 09:01:20 in reply to 4 [link] [source]
Why are you so angry? What did I say that's made you so angry? I don't know how you define "marginal information", but I have to strongly disagree with that comment. As I believe I have provided enough information regarding what I'm trying to do for one thing, along with what I've got so far, INCLUDING the actual error messages I'm getting. I even said before that if further info is required, then tell me what that is and why it's required - so I can provide whatever info that's going to lead to a solution, that's why I said that. I would have thought that DB Browser for SQLite WAS using the same sqlite library my code calls, so don't understand why it wouldn't be. That said, how exactly do I even check that? Again, I don't know how you define "belligerent", but clearly we once again have a very different definition, as I don't believe I was. In any case, that's certainly not what I'm trying to do, nor why I come here. And saying things like "Feel free to ignore this last remark, which is very pertinent to "how to get good answers" but which you will undoubtedly regard as "off topic"." is just looking for and provoking an argument. However, I'm not going to bite and buy into it. Therefore, if you don't want to help, then don't if that's how you want to "help". As, and, at the end of the day nobody is being forced to do anything. And I'm just looking for some help, not some pointless argument that helps nobody. So feel free to ignore this thread in that case, I'm not holding any gun to your head forcing you to have any part in this thread, so go ahead, please yourself, that's fine.
(8) By Gunter Hick (gunter_hick) on 2024-12-02 09:12:10 in reply to 6 [link] [source]
see https://sqlite.org/lang_corefunc.html#sqlite_version SELECT sqlite_version(); Further required info: x) Actual data to reproduce the issue x) expected result x) delivered result
(10) By someone on 2024-12-02 10:49:32 in reply to 8 [link] [source]
See my response below for sqlite versions. I've already answered three questions you've asked. Again, and I'm really not trying to be rude or whatever, but there isn't any other way I can explain it. So, once again: 1) It does not matter what the data is, real, fake, whatever you like/anything. 2) So I only get each path record ONCE, not multiple times if there are multiple file records associated with that same path record. Where ALL path and file records are selected, WITHOUT the same path record being selected more than *once*. There isn't any other way I know of to explain that. Again, it's very baffling to me as to why that seems so difficult to understand, absolutely baffled there. 3) The same error messages from the library itself and the sqlite shell. Although the other issue I spoke of before doesn't seem to be happening now, so I don't know what that was about. In any case, it seems like the only issue now is the error messages I'm getting - except with DB Browser for SQLite, which DOES give me the result I'm after.
(14) By Gunter Hick (gunter_hick) on 2024-12-02 12:33:19 in reply to 10 [link] [source]
I don't think pacman is reporting from the same library you are actually using. Both 3.45.x and 3.46.x know how to handle WITH, whereas 2.8.17 (from December 2005) clearly cannot It would be so much easier if you would just SHOW rather than stubbornly insisting on EXPLAINING. It is not my job to invent test data for your schema and query.
(5) By John Dennis (jdennis) on 2024-12-02 08:02:08 in reply to 1 [link] [source]
Pasting your create commands (minus the double quotes, etc) into the CLI, and then your query, does not return any error (but naturally returns no rows). I am running 3.45.1 on Windows.
What version and platform are you testing on?
(7) By someone on 2024-12-02 09:04:27 in reply to 5 [link] [source]
OS: Manjaro Linux (with the latest updates) SQLite library version: 3.46.1-1 (according to pacman) So it looks like I'm a version(s) ahead of your system as far as the sqlite library itself is concerned.
(9) By Rowan Worth (sqweek) on 2024-12-02 09:13:17 in reply to 1 [link] [source]
What does this query return in all three contexts (DB Browser for SQLite, sqlite shell, your library)?
select sqlite_version();
(11) By someone on 2024-12-02 10:53:34 in reply to 9 [link] [source]
DB Browser for SQLite sqlite version: 3.45.3 sqlite shell sqlite version: 2.8.17 sqlite library version: 3.46.1-1 (as already posted and once again according to pacman) So it seems that while version 3.45.3 doesn't have an issue with my SQL query, the other versions do. So that at least does explain why it works in DB Browser for SQLite, but not the sqlite shell nor the sqlite library itself. So what's changed that's broken my SQL query between versions 3.45.3 and 3.46.1? As I feel that's where the answer is, and that could lead to a solution. Thoughts?
(12) By ian wild (ianwild) on 2024-12-02 12:18:44 in reply to 11 [link] [source]
sqlite shell sqlite version: 2.8.17
Seriously? The one from 2005?
(16) By someone on 2024-12-02 14:29:56 in reply to 12 [link] [source]
I was shocked too. And while I'm not sure what the point of your post was (other than to state the bleeding obvious, that doesn't offer any new information - let alone actually help anyone); I'm not a Manjaro Linux developer, nor am I a Manjaro Linux package maintainer, so how is it my fault they've decided to use such an old version sqlite in the sqlite shell? Well, excuse me, but I have NO say or part in that. So I'd suggest you talk to them about that, as I'm just a humble user of Manjaro.
(17) By Stephan Beal (stephan) on 2024-12-02 14:39:06 in reply to 16 [link] [source]
so how is it my fault they've decided to use such an old version sqlite in the sqlite shell?
No, but you have the very easy option of installing a local copy in your home directory which is newer than two decades old, as documented in the source repo. To summarize:
- Download the latest sources from the links on that page.
- Unpack the downloaded file
- From a terminal, run:
./configure --prefix=$HOME --disable-tcl make
You can then run the sqlite3 shell directly from that directory, without having to install it or adjust your $PATH
.
You also have the option of simply running it in your browser using www:/fiddle.
(20.1) By someone on 2024-12-02 14:55:28 edited from 20.0 in reply to 17 [link] [source]
Sorry, just saw your post. Well, it looks like that's what I'm going to have to do - although I did not know it was using such an old version in the first place until I made the post giving the version of sqlite used in my copy of the sqlite shell. In any case, your post is rather helpful and thank you for your suggestion.
(23) By anonymous on 2024-12-02 15:15:55 in reply to 16 [link] [source]
@someone,
Out of curiosity I opened the thread and carefully read the discussion.
What i observed:
In you original post you stated that you have 2 completely different and seemingly unrelated issues : a) error in SQL statement, and b) wrong query results. Since they are unrelated (until proven otherwie) it would be really helpful if there would be 2 posts.
To clearly and successfully identify the problems (both) you have to provide the schema and if you want a solution for a second issue a test data. Again this goes up to issue number 1.
As you probably know, different OS provide different versions of the software and then depending whether you using a stable or unstable set those versions may divert even further. So the info about the OS and SQLite version used would be required in your OP.
That are my $0.02.
Thank you.
(25) By Spindrift (spindrift) on 2024-12-02 23:17:35 in reply to 16 [link] [source]
The current version of sqlite on the Manjaro repo is 3.43, so it appears that you may be significantly behind with your security updates.
One suspects that the library your code is using may well be similarly prehistoric.
Is it possible for you to make your code execute select sqlite_version()
or is this not possible for your code to execute?
This would be useful information, and I suspect would identify the underlying cause of your difficulties.
(26) By anonymous on 2024-12-03 03:03:47 in reply to 25 [link] [source]
Not very important to the OP's issue but are you sure about the Manjaro repo?
I use Manjaro nearly every day and it has been 3.46.1 for quite awhile.
sqlite> .version
SQLite 3.46.1 2024-08-13 09:16:08 c9c2ab54ba1f5f46360f1b4f35d849cd3f080e6fc2b6c60e91b16c63f69aalt1
zlib version 1.3.1
gcc-14.2.1 20240805 (64-bit)
(29) By Spindrift (spindrift) on 2024-12-03 18:46:29 in reply to 26 [link] [source]
No. I'm not sure, thank you for checking.
I think the point is still valid! The OP is just even further behind than I believed...
(30) By someone on 2024-12-05 04:00:20 in reply to 25 [link] [source]
I've checked again, including with ldd, and my library most certainly is using sqlite version 3.46.1. So I don't know what you were looking at, but pacman isn't lying to me. Given that John Dennis reports that the same code works without error on sqlite 3.45.1, then something has clearly changed between 3.45.1 (or the very next version) and the latest version. I have no idea what that is and I'll leave that up to Richard to figure out what's going on here. It looks very much to me like it's some issue with the sqlite library itself, rather than my SQL code, but again, I'll leave that up the Richard decide.
(33) By Gunter Hick (gunter_hick) on 2024-12-05 07:18:57 in reply to 30 [link] [source]
ldd shows which libraries the image is asking for (when loaded by the current user). To show the actual images loaded by the application (which may be running under a different user and loading different libraries), read the /proc/[pid]/maps file. The assertions "running with 3.46.1" and "not recognizing WITH" tend to be mutually exclusive (unless the library is compiled with SQLITE_OMIT_CTE). Again, this is still you EXPLAINING instead of SHOWING.
(13) By Richard Hipp (drh) on 2024-12-02 12:30:53 in reply to 11 [link] [source]
Let's compare and contrast your bug report (post 2cd113055a0c8aee) with another bug report I received this morning from Suyang Zhong, (post 3f676b1196.
Suyang gives me a concise script that I can copy/paste into a command-line shell to see the problem. Your report requires that I do multiple copy pastes into a separate file, then edit to remove extraneous text and character.
Suyang precisely identifies the specific version of SQLite that exhibits the problem. You've given us lots of identifier information, for various products that we don't support here as well as things that have not been supported since 2005.
Suyang's entire post fits easily on screen. Yours is long and verbose and requires a lot of reading to decode.
I will probably get around to looking into your problem, to see if I can reproduce it. But in as much as your report will requires a lot of time and effort on my part to decode and reproduce, it is a lower priority, whereas I'm busy working on Suyang's problem now.
If you want to increase the priority of your support request, please consider reformatting your request to be more like Suyang's.
(18) By someone on 2024-12-02 14:42:03 in reply to 13 [link] [source]
I didn't know I was even making a bug report in the first place. The same as I don't automatically blame the language itself (be that SQL, C, etc) if I have a problem, because usually when I have a problem it's because I've done something wrong, or haven't done something that I needed to. The same as I don't just blame someone else's library (like the C library) when I have a problem - for the same reason as already stated. Therefore, as far as I knew, it was myself at fault, not the sqlite library itself. I posted the various versions of things here because I was asked to, and it looks like it's directly lead to the answer as to why my SQL code is either working or not working depending on what I use to run it through. In any case, can you confirm that this issue is the result of a bug in the sqlite library itself that I've ran into here, and it's NOT my SQL code that's the issue? If I'm right in the above statement, then take all the time you need to figure it out, that's absolutely fine. In fact, I'd rather it takes more time if it means that the right solution to fix the issue can be implemented, so take all the time you need, not a problem.
(21) By Richard Hipp (drh) on 2024-12-02 14:55:06 in reply to 18 [link] [source]
can you confirm that this issue is the result of a bug
No. I have not looked into the matter yet, as I'm tied up with other issues at the moment.
(31) By someone on 2024-12-05 04:06:54 in reply to 21 [link] [source]
While I don't know I'll get the time today, if there is a way to send you an sql file with the SQL I've posted so far along with some insert statements; I can write you an SQL file with all of that, that should reproduce the issue in whatever you what to test it in, if you want. In any case, at least now I can move forward, and you're far better placed than I to figure out what exactly is going on here.
(34) By Donald Griggs (dfgriggs) on 2024-12-05 14:47:41 in reply to 31 [link] [source]
That sounds great. I can't speak for the development team, but I think they'd advise you to post it in this forum-- one post that contains (as mentioned by G. Hick et al.):
- The version of the sqlite command line utility (I know you've provided this before)
- Exact SQL that anyone can paste without editing into the official sqlite CLI or https://www.sqlite.org/fiddle/ , including data inserts.
- Exactly what you received (results and/or precise error message)
- What you expected to receive instead.
There are many very knowledgeable folks on this forum (plus duller folks like me). SQLite is demonstrably the most-used database on the planet, and we can't expect the small dev team to provide complete (and free!) first-line support for every user question — though they are nonetheless quite attentive to problems. Part of the purpose of this forum is for users to help each other out, with the dev team stepping in when necessary.
Of course, neither Manjaro nor Db Browser are supported here, but this is the correct place to evaluate behavior by sqlite itself.
(35) By someone on 2024-12-08 05:45:22 in reply to 34 [link] [source]
So while I did write an sql script and that worked on both sqlite version 3.45.3 (in DB Browser for SQLite) and 3.46.1 (SQLite shell (sqlite3), the issue was that the sqlite library itself wasn't getting the query with a space in-between the SQL keywords. So the query is working now when passed into the sqlite library itself. So it wasn't any issue with the query itself or the data itself/any of the insert statements. I would mark this as solved, but I don't know how to do that in this forum. Thanks to all those that helped.
(37) By Rowan Worth (sqweek) on 2024-12-09 03:52:22 in reply to 35 [link] [source]
the issue was that the sqlite library itself wasn't getting the query with a space in-between the SQL keywords.
I think it would be a useful exercise for you to review this thread with an eye toward what evidence that was presented that a reader could have used to arrive at this conclusion, and which parts of the discussion only served as a distraction from technical matters.
Glad you got to the root of the problem.
(38.1) By someone on 2025-01-22 13:44:08 edited from 38.0 in reply to 37 [link] [source]
Thank you Rowan. Sorry for the very late reply, as time hasn't been on my side lately as well as a number of other (unrelated) things. I decided that the query I posted in this thread was simply too complicated and too difficult to properly understand, so I've adopted a different solution that works perfectly and gives me exactly what I want. Also, trying to find any documentation on the "magnifier" was simply impossible, as I could not find anything on that no matter what search terms I used. So basically, instead of the above query I've created a separate C function that gets each file record based on the pathid, where to get the paths it's just a simple SELECT * Paths query. So, the flow basically goes like this: * get a path record * call my function to get all file records that have that same pathid * get the next path record * call my function to get all file records that have that same pathid * so on, and so forth until there are no more path records to get The bottom line is that there will be no need to post another thread about fixing the SQL query I posted above. And just to be clear, there are no issues with any of my current SQL queries. Although, and when I have a chance to make sure it is the sqlite library doing it rather than my code, there might be another issue that I might need to refer to the developers of sqlite regarding an issue where it seems the sqlite library is segfaulting where it should be returning an error, not segfaulting. But again, and when I get the time, I'll have to confirm that it's a problem in the sqlite library itself - it does seem it's the sqlite library, but I'll confirm that before I post a thread about it.
(39) By someone on 2025-02-16 09:24:42 in reply to 38.1 [link] [source]
Just a little update: I've fixed the issue I was having with the segfaulting and it was an incorrect pointer being passed that was causing it, and the problem was with my library rather than sqlite. Therefore I won't need to refer anything to the developers of sqlite.
(27) By Kees Nuyt (knu) on 2024-12-03 13:07:17 in reply to 11 [link] [source]
sqlite shell sqlite version: 2.8.17
You probably started sqlite
, where you should use sqlite3
(32) By someone on 2024-12-05 04:11:19 in reply to 27 [link] [source]
Yes, I think you maybe be right about that, my bad. Although, since the sqlite3 shell is using the same version of sqlite as my library is, then it would likely give the same error as the library itself is returning to mine when I try and pass in that same SQL query. So there's still some issue with the sqlite library itself by the looks of it, although I'll let Richard tell us what the story is when he gets a chance to have a look at it and investigate it.
(15) By Gunter Hick (gunter_hick) on 2024-12-02 12:49:22 in reply to 1 [link] [source]
I don't see why you need the CTE at all, it contributes nothing. So in essence you are asking SELECT ... FROM Paths p LEFT JOIN Files f ON f.pathid=p.pathid; For any "Path", this will produce ALL the matching "Files". If you want only 1 result row per "Path", maybe you should GROUP BY "Path"
(19) By someone on 2024-12-02 14:47:32 in reply to 15 [link] [source]
I have no idea what you mean by "CTE" for starters, and not really sure what you mean by the rest of your post. Can you give an actual example, as in the actual code that I can run to see if it gives me the result I need? Again, I'm a visual learner, I need to be able to *see* it to understand it properly, otherwise it's not at all likely going to make much, if any sense, at all to me. Again, *not* trying to be rude, but I never got a choice in that, that was the cards I've been dealt in life. Nothing I can do about it.
(22) By Gunter Hick (gunter_hick) on 2024-12-02 15:01:06 in reply to 19 [link] [source]
see https://sqlite.org/lang_select.html see https://sqlite.org/lang_with.html Look at the railroad syntax diagrams. Find the WITH and GROUP BY boxes. add the following to your statement: .. GROUP BY p.pathid; Once you have that, you can start to think about which of the File rows you want and how to tell SQLite. And here you are, asking for concrete examples, but absolutely refusing to give them yourself.
(24) By ian wild (ianwild) on 2024-12-02 16:28:11 in reply to 19 [link] [source]
I need to be able to see it to understand it properly, otherwise it's not at all likely going to make much, if any sense, at all to me.
Here I know I run the risk of, once more, stating the bleeding obvious, but you have been repeatedly asked to extend the same courtesy to others.
In post (8) you were asked for example data showing the problem. In post (13) you were shown a template of how to make your question more easily answerable. In neither case did you offer even a single INSERT
statement, let alone show "the result you need".
If we can't see your failing test case, how can we hope to fix it?
(28.1) By cj (sqlitening) on 2024-12-03 13:51:16 edited from 28.0 in reply to 1 [link] [source]
Please supply some sample insert statements and expected results. Post #15 looks like a great solution. Drop table if exists Paths;Drop Table if exists Files; CREATE TABLE if not exists Paths (pathid INTEGER PRIMARY KEY NOT NULL, path TEXT NOT NULL UNIQUE ON CONFLICT IGNORE, uid INTEGER NOT NULL, atime INTEGER, mtime INTEGER, ctime INTEGER); CREATE TABLE if not exists Files ( fileid INTEGER PRIMARY KEY NOT NULL, pathid INTEGER NOT NULL REFERENCES Paths(pathid) ON DELETE CASCADE ON UPDATE CASCADE, fname TEXT, inode INTEGER NOT NULL, fsize INTEGER NOT NULL, uid INTEGER NOT NULL, atime INTEGER, mtime INTEGER, ctime INTEGER, type TEXT CONSTRAINT fi_fname_not_null NOT NULL CONSTRAINT fi_fname_not_empt CHECK (fname > '')); INSERT INTO Paths values (1, 'path1',2,3,4,5); INSERT INTO Files values (1, 1,'path1',2,2,2,2,2,2,'mytype'); WITH magnifier(idx) AS ( VALUES (1),(2) ) SELECT COALESCE(f.fname, p.path) AS Path, COALESCE(f.inode, '') AS Inode, COALESCE(f.fsize, '') AS Size, COALESCE(f.uid, '') AS UID, COALESCE(f.atime, '') AS atime, COALESCE(f.mtime, '') AS mtime, COALESCE(f.ctime, '') AS ctime, COALESCE(f.type, '') AS Type FROM Paths p CROSS JOIN magnifier m LEFT JOIN Files f ON m.idx = 2 AND f.pathid = p.pathid ORDER BY p.path, m.idx, f.fname, f.inode, f.fsize, f.uid, f.atime, f.mtime, f.ctime, f.type;
(36) By someone on 2024-12-08 05:45:59 in reply to 28.1 [link] [source]
As I said above, the issue is now resolved.