-
-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dolt panic on index errors #2991
Comments
@CaptainStabs can you manage with the null workaround for one week, until a new release around Monday or so? |
More observations:
hospital_price_transparency_v3> alter table prices drop foreign key g9j30676;
$ dolt checkout prices
$ dolt status
modified: prices
diff --dolt a/prices b/prices
--- a/prices @ i538628tumgj030d4if80n0knri4e2lk
+++ b/prices @ i538628tumgj030d4if80n0knri4e2lk
CREATE TABLE `prices` (
`cms_certification_num` char(6) NOT NULL,
`payer` varchar(256) NOT NULL,
`code` varchar(128) NOT NULL DEFAULT "NONE",
`internal_revenue_code` varchar(128) NOT NULL DEFAULT "NONE",
`units` varchar(128),
`description` varchar(2048),
`inpatient_outpatient` enum('inpatient','outpatient','both','unspecified') NOT NULL DEFAULT "UNSPECIFIED",
`price` decimal(10,2) NOT NULL,
`code_disambiguator` varchar(2048) NOT NULL DEFAULT "NONE",
PRIMARY KEY (`cms_certification_num`,`code`,`inpatient_outpatient`,`internal_revenue_code`,`code_disambiguator`,`payer`),
- KEY `cms_certification_num` (`cms_certification_num`),
- CONSTRAINT `g9j30676` FOREIGN KEY (`cms_certification_num`) REFERENCES `hospitals` (`cms_certification_num`)
+ KEY `cms_certification_num` (`cms_certification_num`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+-----+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
| | cms_certification_num | payer | code | internal_revenue_code | units | description | inpatient_outpatient | price | code_disambiguator |
+-----+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
+-----+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+ Checking out everything still works: $ dolt checkout .
$ dolt status
On branch main
nothing to commit, working tree clean
hospital_price_transparency_v3> select * from prices where cms_certification_num = '210027' limit 1;
+-----------------------+--------------+-------+-----------------------+-------+--------------------------------+----------------------+-------+--------------------+
| cms_certification_num | payer | code | internal_revenue_code | units | description | inpatient_outpatient | price | code_disambiguator |
+-----------------------+--------------+-------+-----------------------+-------+--------------------------------+----------------------+-------+--------------------+
| 210027 | GROSS CHARGE | 10010 | NONE | NULL | FNA BX W/CT GUID EACH ADD LESN | UNSPECIFIED | 1.00 | 3066 |
+-----------------------+--------------+-------+-----------------------+-------+--------------------------------+----------------------+-------+--------------------+
hospital_price_transparency_v3> delete from prices where cms_certification_num = '210027';
Query OK, 12585 rows affected
hospital_price_transparency_v3> select * from prices where cms_certification_num = '210027';
unable to find field with index 0 in row of 0 columns Removing the index fixes this error (removing the index requires removing the FK) hospital_price_transparency_v3> alter table prices drop index cms_certification_num;
hospital_price_transparency_v3> alter table prices drop foreign key g9j30676;
hospital_price_transparency_v3> select * from prices where cms_certification_num = '210027';
+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
| cms_certification_num | payer | code | internal_revenue_code | units | description | inpatient_outpatient | price | code_disambiguator |
+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
hospital_price_transparency_v3> delete from prices where cms_certification_num = '210027';
Query OK, 0 rows affected |
@Hydrocharged @andrew-wm-arthur Looks like this is a case where index iteration is subtly buggy. Can you take a look? |
A couple more clarifications:
It seems like whatever is closing the context should be setting the context error as io.EOF? I haven't been able to repro the error on a fresh database. There's something about the secondary index/foreign key/dolt version of that table contributing to the error that I'm missing. |
@CaptainStabs This PR fixes the root source of the bug #3013, but it does not correct the bounty database that still has an index incompatible with clustered index. In order to fix the secondary index, @alecstein or another bounty participant would have to delete and rebuild the In the meantime, the panic should be fixed, and you can get normal results by sidestepping the secondary index by specifying a filter on the hospital_price_transparency_v3> select * from prices where cms_certification_num = '210027' and code is not null limit 1;
+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
| cms_certification_num | payer | code | internal_revenue_code | units | description | inpatient_outpatient | price | code_disambiguator |
+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+
+-----------------------+-------+------+-----------------------+-------+-------------+----------------------+-------+--------------------+ Until the index is rebuilt, you might see errors like this indicating we've hit a bad index value: hospital_price_transparency_v3> delete from prices where cms_certification_num = '210027';
unexpected nil row
hospital_price_transparency_v3> select * from prices where cms_certification_num = '210027' limit 1;
unable to find field with index 0 in row of 0 columns The select/delete has to return zero results before you'll see these errors. |
Yeah, it wasn't a big issue! |
Same panic with
and cms_certification_num != NULL;
, but no panic withand cms_certification_num IS NOT NULL;
@max-hoffman
The text was updated successfully, but these errors were encountered: