Browse Source

LibSQL: Remove the now-unused ExecutionContext::result object

The INSERT and SELECT statements set up this object for any expression
evaluation to indicate errors. This is no longer needed.
Timothy Flynn 3 năm trước cách đây
mục cha
commit
df2ddcafd4

+ 0 - 1
Userland/Libraries/LibSQL/AST/AST.h

@@ -299,7 +299,6 @@ private:
 
 struct ExecutionContext {
     NonnullRefPtr<Database> database;
-    Optional<Result> result;
     class Statement const* statement;
     Tuple* current_row { nullptr };
 };

+ 0 - 2
Userland/Libraries/LibSQL/AST/Insert.cpp

@@ -39,8 +39,6 @@ ResultOr<ResultSet> Insert::execute(ExecutionContext& context) const
     ResultSet result { SQLCommand::Insert };
     TRY(result.try_ensure_capacity(m_chained_expressions.size()));
 
-    context.result = Result { SQLCommand::Insert };
-
     for (auto& row_expr : m_chained_expressions) {
         for (auto& column_def : table_def->columns()) {
             if (!m_column_names.contains_slow(column_def.name()))

+ 0 - 1
Userland/Libraries/LibSQL/AST/Select.cpp

@@ -48,7 +48,6 @@ ResultOr<ResultSet> Select::execute(ExecutionContext& context) const
         }
     }
 
-    context.result = Result { SQLCommand::Select };
     ResultSet result { SQLCommand::Select };
 
     auto descriptor = adopt_ref(*new TupleDescriptor);

+ 1 - 1
Userland/Libraries/LibSQL/AST/Statement.cpp

@@ -13,7 +13,7 @@ namespace SQL::AST {
 
 ResultOr<ResultSet> Statement::execute(AK::NonnullRefPtr<Database> database) const
 {
-    ExecutionContext context { move(database), {}, this, nullptr };
+    ExecutionContext context { move(database), this, nullptr };
     return execute(context);
 }