Repository navigation
Commit 123ebef
authored
Reject invalid BIT column defaults (#487)
## Summary
Reject invalid `BIT` column defaults instead of preserving unnormalized
input in the emulated information schema. Unsupported values now return
MySQL-compatible error 1067.
## Why
The `BIT` default accepted any value beginning with a valid prefix and
stored the original value. `SHOW CREATE TABLE` later emitted that value
without quoting, allowing untrusted text to become executable SQL in a
generated MySQL dump.
This is a hotfix that requires valid literal forms and rejects anything
that cannot be safely normalized. Broader default validation based on
the AST and full column definition should be done as a follow-up, also
for other types.
This prevents untrusted SQL from being embedded in generated MySQL DDL
during migration.1 parent fedd173 commit 123ebef
4 files changed
Lines changed: 120 additions & 15 deletions
File tree
- packages/mysql-on-sqlite
- src/sqlite
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7908 | 7908 | | |
7909 | 7909 | | |
7910 | 7910 | | |
| 7911 | + | |
| 7912 | + | |
| 7913 | + | |
| 7914 | + | |
| 7915 | + | |
| 7916 | + | |
| 7917 | + | |
| 7918 | + | |
7911 | 7919 | | |
7912 | 7920 | | |
7913 | 7921 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1507 | 1507 | | |
1508 | 1508 | | |
1509 | 1509 | | |
1510 | | - | |
| 1510 | + | |
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
| |||
2043 | 2043 | | |
2044 | 2044 | | |
2045 | 2045 | | |
2046 | | - | |
2047 | | - | |
2048 | | - | |
| 2046 | + | |
| 2047 | + | |
| 2048 | + | |
| 2049 | + | |
2049 | 2050 | | |
2050 | | - | |
| 2051 | + | |
2051 | 2052 | | |
2052 | 2053 | | |
2053 | 2054 | | |
| |||
2081 | 2082 | | |
2082 | 2083 | | |
2083 | 2084 | | |
2084 | | - | |
| 2085 | + | |
2085 | 2086 | | |
2086 | 2087 | | |
2087 | 2088 | | |
| |||
2096 | 2097 | | |
2097 | 2098 | | |
2098 | 2099 | | |
2099 | | - | |
2100 | | - | |
2101 | | - | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
2102 | 2104 | | |
2103 | | - | |
| 2105 | + | |
2104 | 2106 | | |
2105 | 2107 | | |
2106 | 2108 | | |
| |||
2116 | 2118 | | |
2117 | 2119 | | |
2118 | 2120 | | |
2119 | | - | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
2120 | 2130 | | |
2121 | 2131 | | |
2122 | 2132 | | |
| |||
2142 | 2152 | | |
2143 | 2153 | | |
2144 | 2154 | | |
| 2155 | + | |
| 2156 | + | |
| 2157 | + | |
| 2158 | + | |
| 2159 | + | |
2145 | 2160 | | |
2146 | | - | |
2147 | | - | |
| 2161 | + | |
| 2162 | + | |
| 2163 | + | |
| 2164 | + | |
| 2165 | + | |
2148 | 2166 | | |
2149 | 2167 | | |
2150 | 2168 | | |
2151 | 2169 | | |
2152 | | - | |
2153 | | - | |
| 2170 | + | |
| 2171 | + | |
| 2172 | + | |
| 2173 | + | |
| 2174 | + | |
2154 | 2175 | | |
2155 | 2176 | | |
2156 | 2177 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
151 | 152 | | |
152 | 153 | | |
153 | 154 | | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
154 | 169 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
704 | 704 | | |
705 | 705 | | |
706 | 706 | | |
| 707 | + | |
707 | 708 | | |
708 | 709 | | |
709 | 710 | | |
| |||
718 | 719 | | |
719 | 720 | | |
720 | 721 | | |
| 722 | + | |
721 | 723 | | |
722 | 724 | | |
723 | 725 | | |
| |||
734 | 736 | | |
735 | 737 | | |
736 | 738 | | |
| 739 | + | |
737 | 740 | | |
738 | 741 | | |
739 | 742 | | |
| |||
748 | 751 | | |
749 | 752 | | |
750 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
751 | 812 | | |
752 | 813 | | |
753 | 814 | | |
| |||
0 commit comments