-
-
Couldn't load subscription status.
- Fork 404
Open
Labels
affects: technical debtImproves the state of the codebaseImproves the state of the codebasehelp wantedCommunity contributors can implement thisCommunity contributors can implement thisreadyReady for implementationReady for implementationwork: db-layerRelated to SQL or PL/pgSQLRelated to SQL or PL/pgSQL
Description
Description
During the development of bulk_insert aka Import into existing tables, we ran into bugs caused by some edge cases. Even though these bugs are now fixed, it would be good to have SQL tests for these so that we could avoid regressions in the future.
Affects users
None
This may change if we do end up finding more bugs while writing tests.
Affects developers
Low
Having these test would mean that we would avoid running into regressions in the future. This could also help us discover more bugs during the process of adding these tests.
Suggested change
Tests to be added:
- For
msar.prepare_temp_table_for_import- Passing one or more columns named
iddoesn't throw an error. - A
TEMPORARY TABLEis actually created on the database with or without a giventab_name. - Happy case: Valid
tab_nameandcol_namescreate a temporary table on the database with expected table and column names and return thecopy_sqlandtable_oidfor the relevant temporary table.
- Passing one or more columns named
- For
msar.insert_from_select- An error is thrown when inserting when mapping is made from a
texttype column intointegertype column, i.e. there is a mismatch in datatypes of src and destination table and the src columns cannot be casted to valid dst column types. - Happy case: Records from the given
srctable are inserted intodsttable according to themappingsprovided.
- An error is thrown when inserting when mapping is made from a
Additional context
Metadata
Metadata
Assignees
Labels
affects: technical debtImproves the state of the codebaseImproves the state of the codebasehelp wantedCommunity contributors can implement thisCommunity contributors can implement thisreadyReady for implementationReady for implementationwork: db-layerRelated to SQL or PL/pgSQLRelated to SQL or PL/pgSQL