ladybird/Userland/Libraries/LibSQL/AST
Timothy Flynn 72e41a7dbd LibSQL: Support 64-bit integer values and handle overflow errors
Currently, integers are stored in LibSQL as 32-bit signed integers, even
if the provided type is unsigned. This resulted in a series of unchecked
unsigned-to-signed conversions, and prevented storing 64-bit values.
Further, mathematical operations were performed without similar checks,
and without checking for overflow.

This changes SQL::Value to behave like SQLite for INTEGER types. In
SQLite, the INTEGER type does not imply a size or signedness of the
underlying type. Instead, SQLite determines on-the-fly what type is
needed as values are created and updated.

To do so, the SQL::Value variant can now hold an i64 or u64 integer. If
a specific type is requested, invalid conversions are now explictly an
error (e.g. converting a stored -1 to a u64 will fail). When binary
mathematical operations are performed, we now try to coerce the RHS
value to a type that works with the LHS value, failing the operation if
that isn't possible. Any overflow or invalid operation (e.g. bitshifting
a 64-bit value by more than 64 bytes) is an error.
2022-12-14 09:21:30 -05:00
..
AST.h LibSQL: Parse and execute sequential placeholder values 2022-12-07 13:09:00 +01:00
CreateSchema.cpp LibSQL+SQLServer: Return a NonnullRefPtr from Database::get_schema 2022-11-30 11:43:13 +01:00
CreateTable.cpp LibSQL+SQLServer: Return a NonnullRefPtr from Database::get_table 2022-11-30 11:43:13 +01:00
Delete.cpp LibSQL+SQLServer+sql: Send and parse the correct number of changed rows 2022-12-07 13:09:00 +01:00
Describe.cpp LibSQL+SQLServer: Return a NonnullRefPtr from Database::get_table 2022-11-30 11:43:13 +01:00
Expression.cpp LibSQL: Support 64-bit integer values and handle overflow errors 2022-12-14 09:21:30 -05:00
Insert.cpp LibSQL: Partially implement the UPDATE command 2022-12-07 13:09:00 +01:00
Lexer.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Lexer.h AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Parser.cpp LibSQL: Parse and execute sequential placeholder values 2022-12-07 13:09:00 +01:00
Parser.h LibSQL: Parse and execute sequential placeholder values 2022-12-07 13:09:00 +01:00
Select.cpp LibSQL: Support 64-bit integer values and handle overflow errors 2022-12-14 09:21:30 -05:00
Statement.cpp LibSQL: Parse and execute sequential placeholder values 2022-12-07 13:09:00 +01:00
SyntaxHighlighter.cpp Libraries: Use default constructors/destructors in LibSQL 2022-03-13 22:34:38 +01:00
SyntaxHighlighter.h LibSyntax: Teach each highlighter about it's comment syntax 2022-11-27 18:28:43 -07:00
Token.cpp AK+Everywhere: Rename String to DeprecatedString 2022-12-06 08:54:33 +01:00
Token.h LibSQL: Parse and execute sequential placeholder values 2022-12-07 13:09:00 +01:00
Update.cpp LibSQL: Partially implement the UPDATE command 2022-12-07 13:09:00 +01:00