News for hackers. Stuff that matters.
Re:I Went to SQL Injection Court by hyperpape on Tuesday February 25, 2025 @03:09PM (#43176691)
It literally does not describe a file, and does not literally describe the data layout of anything on disk (though with enough knowledge, you may be able to infer facts about probable layouts).
Re:I Went to SQL Injection Court by paulddraper on Tuesday February 25, 2025 @03:19PM (#43176843)
> does not literally describe the data layout of anything on disk

Huh? Depends on the DMBS, but each InnoDB table is a file.

And the schema determines the file structure.

Re:I Went to SQL Injection Court by kelnos on Tuesday February 25, 2025 @03:52PM (#43177247)
Schema is an abstraction over the file structure. Different RDBMSes will use different file layouts for a given schema. The same RDBMS may even have different engines that use different file layouts, or may change file layout between major versions.

"Determines" is too weak: it must be "is". If "schema is file layout" is true, then sure, a schema is a file layout. But if it is merely "schema determines file layout", then no, a schema is not a file layout.

Re:I Went to SQL Injection Court by hot_gril on Tuesday February 25, 2025 @04:07PM (#43177415)
Abstractions are notoriously leaky in DBMSes. First off, they don't even use the same SQL spec. Give me a schema that uses anything Postgres-specific, and I can tell you what the bytes look like for a given row or index.

I think it's a moot point anyway because the language is broader than just files in the filesystem sense.

Re:I Went to SQL Injection Court by hyperpape on Tuesday February 25, 2025 @03:28PM (#43176936)
> but each InnoDB table is a file.

A table isn't a schema, it is a component of a schema, and most databases don't use InnoDB.

Re:I Went to SQL Injection Court by paulddraper on Tuesday February 25, 2025 @03:32PM (#43176989)
> it is a component of a schema

So if you have the schema, you have the tables.