question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Additional column data is stripped out during modifyDataType change for BLOB, TEXT column types in MySQL

See original GitHub issue

Environment

Liquibase Version: 4.4.0 / 4.15.0

Liquibase Integration & Version: CLI

Description

modifyDataType changesets for BLOB, TEXT types columns result in a SQL query without additional information.

Steps To Reproduce

  1. Create a modifyDataType changeset with a column of type BLOB
database changelog:
  - changeSet:
      id: test
      changes:
        - modifyDataType:
            tableName: foo
            columnName: bar
            newDataType: "BLOB NOT NULL"
  1. Run update-sql

Actual Behavior

MySQL statement without additional information about the column is generated.

ALTER TABLE foo MODIFY bar BLOB;

Expected/Desired Behavior

MySQL statement with additional information about the column is generated.

ALTER TABLE foo MODIFY bar BLOB NOT NULL;

Additional Context

The issue seems to caused by missing type.addAdditionalInformation(getAdditionalInformation()); call for a few types including BLOB and TEXT. The changeset works as expected for INT or VARCHAR.

Thanks!

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
FBurguercommented, Sep 20, 2022

Looks like this issue was also posted by @Vampire on #1763. We will continue the follow up and close the other one

1reaction
kataggartcommented, Sep 14, 2022

@shkin Thanks will take another look and clarify/resolve

Read more comments on GitHub >

github_iconTop Results From Across the Web

11.3.4 The BLOB and TEXT Types - MySQL :: Developer Zone
For TEXT and BLOB columns, there is no padding on insert and no bytes are stripped on select. If a TEXT column is...
Read more >
changelog.txt · xiaowu/liquibase-3.10.2 - Gitee.com
Improved `generateChangeLog` command to assume a `diffTypes` that includes "data" when the `dataOutputDirectory` parameter is used.
Read more >
how to add to a column in sql Code Example - Code Grepper
ADD COLUMN phone VARCHAR(15) AFTER name;. 6. Code language: SQL (Structured Query Language) (sql). Source: www.mysqltutorial.org. Add a Grepper Answer ...
Read more >
Chapter 4, Optimizing Schema and Data Types - O'Reilly
These data types changed greatly in versions 4.1 and 5.0, which makes them even more complicated. Since MySQL 4.1, each string column can...
Read more >
mysql - Remove special characters from a database field
update mytable set FieldName = REPLACE(FieldName,'/',''). That's a good place to start.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found