db_tutorial icon indicating copy to clipboard operation
db_tutorial copied to clipboard

Part4 Error

Open shinyewon opened this issue 1 year ago • 0 comments

it 'prints error message when table is full' do
  script = (1..1401).map do |i|
    "insert #{i} user#{i} person#{i}@example.com"
  end
  script << ".exit"
  result = run_script(script)
  expect(result[-2]).to eq('db > Error: Table full.')
end

Testing of the above code runs successfully after applying the following changes:

 const uint32_t COLUMN_EMAIL_SIZE = 255;
 typedef struct {
   uint32_t id;
-  char username[COLUMN_USERNAME_SIZE];
-  char email[COLUMN_EMAIL_SIZE];
+  char username[COLUMN_USERNAME_SIZE + 1];
+  char email[COLUMN_EMAIL_SIZE + 1];
 } Row;

shinyewon avatar Aug 20 '24 11:08 shinyewon