From a02b724eafff6fccfda784e5a363460ffe7f62c4 Mon Sep 17 00:00:00 2001
From: unknown <miguel@hegel.local>
Date: Wed, 5 May 2004 10:54:11 -0300
Subject: [PATCH] Fixes for prior commit

mysys/my_getsystime.c:
  Applied Sergei's fixes
sql/sql_prepare.cc:
  Fix prior commit
---
 mysys/my_getsystime.c | 2 ++
 sql/sql_prepare.cc    | 6 +++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/mysys/my_getsystime.c b/mysys/my_getsystime.c
index c07dd8eb32e..91c977f0b5a 100644
--- a/mysys/my_getsystime.c
+++ b/mysys/my_getsystime.c
@@ -47,6 +47,8 @@ ulonglong my_getsystime()
     offset=li.QuadPart-OFFSET_TO_EPOC;
     QueryPerformanceFrequency(&li);
     freq=li.QuadPart;
+    QueryPerformanceCounter(&t_cnt);
+    offset-=t_cnt.QuadPart/freq*10000000+t_cnt.QuadPart%freq*10000000/freq;
   }
   QueryPerformanceCounter(&t_cnt);
   return t_cnt.QuadPart/freq*10000000+t_cnt.QuadPart%freq*10000000/freq+offset;
diff --git a/sql/sql_prepare.cc b/sql/sql_prepare.cc
index 27f0c7a7c45..d8550768e3a 100644
--- a/sql/sql_prepare.cc
+++ b/sql/sql_prepare.cc
@@ -1005,7 +1005,7 @@ static int mysql_test_set_fields(Prepared_statement *stmt,
   RETURN VALUE
     0   success
     1   error, sent to client
-   -1   error, not sent to client    
+   -1   error, not sent to client
 */
 static int select_like_statement_test(Prepared_statement *stmt,
 				      TABLE_LIST *tables)
@@ -1147,11 +1147,11 @@ static int mysql_test_insert_select(Prepared_statement *stmt,
   TABLE_LIST *first_local_table=
     (TABLE_LIST *)lex->select_lex.table_list.first;
   /* Skip first table, which is the table we are inserting in */
-  lex->select_lex.table_list.first= (uchar*) first_local_table->next;
+  lex->select_lex.table_list.first= (byte*) first_local_table->next;
   lex->select_lex.resolve_mode= SELECT_LEX::NOMATTER_MODE;
   res= select_like_statement_test(stmt, tables);
   /* revert changes*/
-  lex->select_lex.table_list.first= (uchar*) first_local_table;
+  lex->select_lex.table_list.first= (byte*) first_local_table;
   lex->select_lex.resolve_mode= SELECT_LEX::INSERT_MODE;
   return res;
 }
-- 
2.30.9