Allow the option of using null values in vindex fields#4146
Allow the option of using null values in vindex fields#4146sougou merged 2 commits intovitessio:masterfrom
Conversation
|
This is a good idea! I wanted to work on this at some point but never got a change to get to it. I was thinking that we don't need an extra option and we can relax the constraint entirely and let MySQL enforce it (i.e if you require some fields of the lookup table to not be null, you set it in the schema there). |
|
I like @rafael's suggestion. The check was previously there because the null value was previously used to figure out if a sequence number had to be generated. But the design has now changed and the sequence generation logic happens well before here. So, the null check is unnecessary. A vindex could still choose to disallow nulls, but that will be up to the vindex implementor to make this decision. This means that we should revisit our vindexes to decide if we should allow them to accept nulls. I feel like lookup should not, but it's debatable. TL;DR: Let's delete the null check altogether. |
Signed-off-by: Aaron Young <young@squareup.com>
26ab342 to
9c1137c
Compare
|
Cool, makes sense, done. |
|
Tests need fixing. |
Signed-off-by: Aaron Young <young@squareup.com>
No description provided.