Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

SHA output different for Java and for MySQL

 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings all,

This code


yields


but in MySQL 5.0.51a

yields


what do I need to do to get my Java code's result to match what MySQL generates?


TIA,

Still-learning Steve
 
Wouter Oet
Saloon Keeper
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're doing an update and a digest with the same value. So you're adding it twice. Just remove the update.
 
Stuart Rogers
Ranch Hand
Posts: 141
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
D-oH! Serves me right for trying to code at 02:45 . Yes you are absolutely correct.

CASE CLOSED

Thanks!

Still-learning-and-sleepy Steve
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic