Django

Code

Ticket #11393 (closed: wontfix)

Opened 9 months ago

Last modified 9 months ago

query on decimal fields with long string representation of float causes exception

Reported by: rclark Assigned to: nobody
Milestone: Component: Uncategorized
Version: 1.0 Keywords:
Cc: Triage Stage: Unreviewed
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

When a querying a decimal field in mysql passing a string representation of a float with more than 6000 characters, an exception occurs.

DjangoModel.objects.filter(num_field__gte="1.000000000000000000000000000000000000000000.....")

_mysql_exceptions.Warning: Truncated incorrect DOUBLE value: '1.000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'

As you add more characters mysql's performance seriously degrades.

Attachments

Change History

06/26/09 20:09:06 changed by russellm

  • status changed from new to closed.
  • needs_better_patch changed.
  • resolution set to wontfix.
  • needs_tests changed.
  • needs_docs changed.

"Doctor! It hurts when I do this" "Then stop doing that!"

Erm... yeah. Ok. Good to know, but I don't think we're going to try and fix this one. The official position on this bug is going to be "ah... don't do that".

I am, however, slightly intrigued at the kind of use case that requires 6000+ significant figure of floating point representation...


Add/Change #11393 (query on decimal fields with long string representation of float causes exception)




Change Properties
Action