From ae279eae3b0b944a140201a5fa93be1b2a313811 Mon Sep 17 00:00:00 2001 From: "serg@serg.mylan" <> Date: Sun, 14 Mar 2004 11:50:15 +0100 Subject: [PATCH] UUID() bug that manifests itself on low-res (<1 us) timers only (and not critical at all as it does not result in repeated values) --- sql/item_strfunc.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 518b9ca624b..bcf534c9e84 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -2754,7 +2754,14 @@ String *Item_func_uuid::val_str(String *str) tv++; } else - nanoseq=0; + { + if (nanoseq) + { + tv-=nanoseq; + nanoseq=0; + } + DBUG_ASSERT(tv > uuid_time); + } uuid_time=tv; pthread_mutex_unlock(&LOCK_uuid_generator);