[Django] #34492: I get an error when using BinaryField in sqllite3.

7 views
Skip to first unread message

Django

unread,
Apr 14, 2023, 2:52:47 AM4/14/23
to django-...@googlegroups.com
#34492: I get an error when using BinaryField in sqllite3.
-------------------------------------+-------------------------------------
Reporter: Taikono- | Owner: nobody
Himazin |
Type: | Status: new
Uncategorized |
Component: Database | Version: 3.2
layer (models, ORM) |
Severity: Normal | Keywords: BinaryField
Triage Stage: | Has patch: 0
Unreviewed |
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------+-------------------------------------
I'm working with data in Blobs in sqlite. It is purely binary (like an
image for example) and not information that can be converted to a string.
When I get that data through django's model, I get the following error:


{{{
File "\site-packages\django\db\models\query.py", line 674, in first
for obj in (self if self.ordered else self.order_by('pk'))[:1]:
File "\site-packages\django\db\models\query.py", line 280, in __iter__
self._fetch_all()
File "\site-packages\django\db\models\query.py", line 1324, in
_fetch_all
self._result_cache = list(self._iterable_class(self))
File "\site-packages\django\db\models\query.py", line 51, in __iter__
results = compiler.execute_sql(chunked_fetch=self.chunked_fetch,
chunk_size=self.chunk_size)
File "\site-packages\django\db\models\sql\compiler.py", line 1175, in
execute_sql
cursor.execute(sql, params)
File "\site-packages\django\db\backends\utils.py", line 98, in execute
return super().execute(sql, params)
File "\site-packages\django\db\backends\utils.py", line 66, in execute
return self._execute_with_wrappers(sql, params, many=False,
executor=self._execute)
File "\site-packages\django\db\backends\utils.py", line 75, in
_execute_with_wrappers
return executor(sql, params, many, context)
File "\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "\site-packages\django\db\utils.py", line 90, in __exit__
raise dj_exc_value.with_traceback(traceback) from exc_value
File "\site-packages\django\db\backends\utils.py", line 84, in _execute
return self.cursor.execute(sql, params)
File "\site-packages\django\db\backends\sqlite3\base.py", line 423, in
execute
return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: Could not decode to UTF-8 column
'msrepl_synctran_ts' with text ''
}}}


I researched quite a bit about this, but there wasn't much information on
the internet.
Please suggest me a workaround. I'm sorry I can't handle this with python.

--
Ticket URL: <https://code.djangoproject.com/ticket/34492>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 14, 2023, 2:53:54 AM4/14/23
to django-...@googlegroups.com
#34492: I get an error when using BinaryField in sqllite3.
-------------------------------------+-------------------------------------
Reporter: Taikono-Himazin | Owner: nobody
Type: Uncategorized | Status: new
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution:
Keywords: BinaryField | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Taikono-Himazin:

Old description:

New description:

I don't want the msrepl_synctran_ts data to be editable in django's model.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34492#comment:1>

Django

unread,
Apr 14, 2023, 2:55:03 AM4/14/23
to django-...@googlegroups.com

Old description:

New description:

I don't need the msrepl_synctran_ts data to be visible/editable in the
django model. I just want to load a model with a column called
msrepl_synctran_ts.

--

--
Ticket URL: <https://code.djangoproject.com/ticket/34492#comment:2>

Django

unread,
Apr 14, 2023, 2:57:46 AM4/14/23
to django-...@googlegroups.com
#34492: I get an error when using BinaryField in sqllite3.
-------------------------------------+-------------------------------------
Reporter: Taikono-Himazin | Owner: nobody
Type: Uncategorized | Status: closed

Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: invalid

Keywords: BinaryField | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

* status: new => closed
* resolution: => invalid


Comment:

Please don't use Trac as a support channel. Closing per
TicketClosingReasons/UseSupportChannels. I'm happy to respond on support
channels.

--
Ticket URL: <https://code.djangoproject.com/ticket/34492#comment:3>

Django

unread,
Apr 14, 2023, 3:34:11 AM4/14/23
to django-...@googlegroups.com
#34492: I get an error when using BinaryField in sqllite3.
-------------------------------------+-------------------------------------
Reporter: Taikono-Himazin | Owner: nobody
Type: Uncategorized | Status: closed
Component: Database layer | Version: 3.2
(models, ORM) |
Severity: Normal | Resolution: invalid
Keywords: BinaryField | Triage Stage:
| Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Taikono-Himazin):

Oh, I'm sorry.

--
Ticket URL: <https://code.djangoproject.com/ticket/34492#comment:4>

Reply all
Reply to author
Forward
0 new messages