Why is the database that tests are being run on in #AZ9 not available for debugging?

I’m stuck on Stage #AZ9 of the SQLite challenge. When I debug my code using the provided sample.db, it works exactly as it should, but when the tester runs it, it is unhappy with the values that my code puts out. However, since the database file that tests are being run on is no longer sample.db, but some file that I don’t have access to / that is being generated on your end for the purpose of the test, I can’t debug my code to see where the problem lies. I tried setting debug to true, and that yields slightly more information (i.e. what columns the testing table has and what values my code is expected to produce), but not enough to reproduce the problem locally.

Hi @Convl, you can run download_sample_databases.sh in your repo to get more sample db files for debugging.

The sample databases that are available for download there are much larger and contain tables that span multiple pages. Reading such tables is a feature that only gets implemented in the later stages of the project. At #AZ9, tables still fit on a single page, like the ones in sample.db. The problem is that my code works for sample.db, but it does not work for the tables that are used for testing, and there seems to be no way of downloading those.

Let me see if I can locate a copy of the db file we’re using for the test.

In the meantime, could you share more details on the specific errors you’re encountering?

I think the test database gets dynamically generated on every test run (or at least, there are a number of test databases and the tester picks one of them on each run?) - but any of the test databases would probably help in tracking down the error.
The error message I get makes me think my program might be reading from a different column than the one that is intended. I actually tried changing my code so it would read from the column with the next-nighest or next-lowest index instead, but that didn’t help, either. I’ll paste you a log from the last test I ran here:
remote: [tester::#AZ9] Creating test.db with table: watermelon
remote: [tester::#AZ9] Columns in table: chocolate, vanilla, banana, grape, pistachio
remote: [tester::#AZ9] $ ./your_program.sh test.db “select chocolate from watermelon”
remote: [your_program] Logs from your program will appear here!
remote: [your_program] Kaylah
remote: [your_program] Lavada
remote: [your_program] Shanie
remote: [your_program] Darby
remote: [your_program] Anastasia
remote: [your_program] Madelynn
remote: [tester::#AZ9] Expected exactly 4 lines of output, got: 6
remote: [tester::#AZ9] Test failed

I modified my code to print out every value in every column instead. Seems like it is getting the right column, but not getting every value from it (it only prints 5 values from the “butterscotch” column, but apparently 7 were expected):

remote: [tester::#AZ9] Columns in table: coconut, banana, strawberry, butterscotch, watermelon
remote: [tester::#AZ9] $ ./your_program.sh test.db “select butterscotch from coffee”
remote: [your_program] Logs from your program will appear here!
remote: [your_program] Table name: coffee, column name: coconut
remote: [your_program] Sheila
remote: [your_program] Ilene
remote: [your_program] Itzel
remote: [your_program] Meghan
remote: [your_program] Elissa
remote: [your_program] Karli
remote: [your_program] Marta
remote: [your_program] Alexa
remote: [your_program] Bella
remote: [your_program] Abby
remote: [your_program] Zoie
remote: [your_program] Isabell
remote: [your_program] Tressie
remote: [your_program] Table name: coffee, column name: banana
remote: [your_program] Antonetta
remote: [your_program] Anne
remote: [your_program] Rowena
remote: [your_program] Lessie
remote: [your_program] Addie
remote: [your_program] Table name: coffee, column name: strawberry
remote: [your_program] Johanna
remote: [your_program] Destini
remote: [your_program] Blanca
remote: [your_program] Chyna
remote: [your_program] Willa
remote: [your_program] Ona
remote: [your_program] Tressie
remote: [your_program] Samanta
remote: [your_program] Matilda
remote: [your_program] Ophelia
remote: [your_program] Table name: coffee, column name: butterscotch
remote: [your_program] Lisa
remote: [your_program] Johanna
remote: [your_program] Margret
remote: [your_program] Aliyah
remote: [your_program] Maximillia
remote: [your_program] Table name: coffee, column name: watermelon
remote: [your_program] Luna
remote: [your_program] Pink
remote: [tester::#AZ9] Expected exactly 7 lines of output, got: 40
remote: [tester::#AZ9] Test failed

Notice how it works just fine on samples.db:
Table name: apples, column name: name
Granny Smith
Fuji
Honeycrisp
Golden Delicious
Table name: apples, column name: color
Light Green
Red
Blush Red
Yellow
Table name: oranges, column name: name
Mandarin
Tangelo
Tangerine
Clementine
Valencia Orange
Navel Orange
Table name: oranges, column name: description
great for snacking
sweet and tart
great for sweeter juice
usually seedless, great for snacking
best for juicing
sweet with slight bitterness

@Convl Yep, our tester creates a new db file with random values each time it runs. I ran it twice and generated two files for you:

strawberry.db (8 KB)
watermelon.db (8 KB)

Awesome, thank you very much!

1 Like

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.