Skip to content

Commit

Permalink
Feature/test (#42)
Browse files Browse the repository at this point in the history
* feat: mysql 5 dd column type ENUM SET

* refa: deploy script use click

* fix: parse set

* fix: set bit parse

* fix: mysql 5 parse set column type error
  • Loading branch information
WinChua authored Jul 21, 2024
1 parent 3d65b35 commit ba7e54a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/pyinnodb/cli/frm.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ def frm(ctx, frmfile):
ibd.seek(root_page_no * const.PAGE_SIZE)
root_index_page = MIndexPage.parse_stream(ibd)
first_leaf_page = root_index_page.get_first_leaf_page(ibd, t.get_primary_key_col())
print(first_leaf_page)

default_value_parser = MIndexPage.default_value_parser(t, hidden_col=False)

Expand Down
6 changes: 3 additions & 3 deletions src/pyinnodb/frm/frm.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ def to_dd_column(self, name: str, pos: int, labels: typing.List[typing.List[str]
c.numeric_precision -= 1
if c.numeric_precision:
c.numeric_precision -= 1
elif c.type == [const.dd_column_type.DDColumnType.ENUM.value,
elif c.type in [const.dd_column_type.DDColumnType.ENUM.value,
const.dd_column_type.DDColumnType.SET.value]:
c.size = 1
if self.label_id <= len(labels):
for i, name in enumerate(labels[self.label_id-1]):
c.elements.append(ColumnElement(name=b64encode(name), index=i+1))
Expand Down Expand Up @@ -272,7 +271,8 @@ def _post_parsed(self, stream, context, path):

column_names = names[1:-2].split(b"\xff")
self.column_labels = [
g.split(b"\xff") for g in labels[1:-2].split(b"\x00") if g
[v for v in g.split(b'\xff') if v]
for g in labels.split(b'\x00') if g
]


Expand Down

0 comments on commit ba7e54a

Please sign in to comment.