Done.
$ python manage.py sqlmigrate myapp 0003_somechange
BEGIN;
--
-- Add field text1 to mytable
--
ALTER TABLE `myapp_mytable` ADD COLUMN `text1` longtext NOT NULL;
UPDATE `myapp_mytable` SET `text1` = b"''";
COMMIT;
$ cat myapp/migrations/0003_somechange.py
# Generated by Django 2.0.2 on 2018-02-02 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('myapp', '0002_auto_20180202_1154'),
]
operations = [
migrations.AddField(
model_name='mytable',
name='text1',
field=models.TextField(default=''),
preserve_default=False,
),
]
$ python --version
Python 3.4.2
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29103>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:1>
* stage: Unreviewed => Accepted
* easy: 1 => 0
Comment:
This is MySQL-specific. I couldn't quickly locate where the problem is.
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:2>
* has_patch: 0 => 1
Comment:
[https://github.com/django/django/pull/9680 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:3>
Comment (by Claude Paroz):
It's still not entirely clear to me what is the correct expected output. I
think that internally, mysqlclient is using the `'surrogateescape'`
encoding which is apparently not usable for some outputs like the shell.
Any suggestion welcome.
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:4>
Comment (by Claude Paroz):
Ah sorry, in the current use case, the expected output is simply no binary
marker, which is fixed in my patch.
My question is about the SQL output in the hypothetic case the default
would be a real binary bytestring.
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:5>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:6>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"3c4ff2176323dd20507e35658599da220fbe1741" 3c4ff217]:
{{{
#!CommitTicketReference repository=""
revision="3c4ff2176323dd20507e35658599da220fbe1741"
Fixed #29103 -- Removed bad 'b'-prefix added by MySQL's
SchemaEditor.quote_value().
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/29103#comment:7>