summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreggie@big_geek. <>2006-05-24 12:43:03 -0500
committerreggie@big_geek. <>2006-05-24 12:43:03 -0500
commit4a25f024ee7ee0591a001fa144368b9c964a2dff (patch)
treeaf9751119a8093c02864b8e095e7ab41cf95e1cd
parent86787fb3b8f6fc0ad645274feb626a37ac3bba91 (diff)
downloadmariadb-git-4a25f024ee7ee0591a001fa144368b9c964a2dff.tar.gz
some small fixups
-rw-r--r--include/config-win.h1
-rw-r--r--sql/net_serv.cc7
-rw-r--r--storage/csv/ha_tina.cc20
3 files changed, 18 insertions, 10 deletions
diff --git a/include/config-win.h b/include/config-win.h
index d540465c2f9..aa372762191 100644
--- a/include/config-win.h
+++ b/include/config-win.h
@@ -25,6 +25,7 @@ functions */
#if defined(_MSC_VER) && _MSC_VER >= 1400
/* Avoid endless warnings about sprintf() etc. being unsafe. */
#define _CRT_SECURE_NO_DEPRECATE 1
+#define _USE_32BIT_TIME_T 1 /* force time_t to be 32 bit */
#endif
#include <sys/locking.h>
diff --git a/sql/net_serv.cc b/sql/net_serv.cc
index 6763196ec37..03164827e8f 100644
--- a/sql/net_serv.cc
+++ b/sql/net_serv.cc
@@ -37,9 +37,6 @@
HFTODO this must be hidden if we don't want client capabilities in
embedded library
*/
-#ifdef __WIN__
-#include <winsock.h>
-#endif
#include <my_global.h>
#include <mysql.h>
#include <mysql_embed.h>
@@ -51,7 +48,9 @@
#include <violite.h>
#include <signal.h>
#include <errno.h>
-
+#ifdef __WIN__
+#include <winsock.h>
+#endif
#ifdef __NETWARE__
#include <sys/select.h>
#endif
diff --git a/storage/csv/ha_tina.cc b/storage/csv/ha_tina.cc
index a26114e086d..6e0de1bc57d 100644
--- a/storage/csv/ha_tina.cc
+++ b/storage/csv/ha_tina.cc
@@ -472,13 +472,20 @@ int tina_end(ha_panic_function type)
/*
Finds the end of a line.
- Currently only supports files written on a UNIX OS.
+ Supports DOS, Unix, or Mac OS line endings.
*/
-byte * find_eoln(byte *data, off_t begin, off_t end)
+byte * find_eoln(byte *data, off_t begin, off_t end, int *eoln_len)
{
+ off_t dataend= begin;
+ *eoln_len= 0;
+
for (off_t x= begin; x < end; x++)
- if (data[x] == '\n')
- return data + x;
+ if (data[x] == '\r' || data[x] == '\n')
+ (*eoln_len)++;
+ else if (!(*eoln_len))
+ dataend++;
+ else
+ return data+dataend;
return 0;
}
@@ -627,6 +634,7 @@ int ha_tina::find_current_row(byte *buf)
{
byte *mapped_ptr;
byte *end_ptr;
+ int eoln_len;
DBUG_ENTER("ha_tina::find_current_row");
mapped_ptr= (byte *)share->mapped_file + current_position;
@@ -636,7 +644,7 @@ int ha_tina::find_current_row(byte *buf)
not to conflict with undergoing concurrent insert.
*/
if ((end_ptr= find_eoln(share->mapped_file, current_position,
- local_saved_data_file_length)) == 0)
+ local_saved_data_file_length, &eoln_len)) == 0)
DBUG_RETURN(HA_ERR_END_OF_FILE);
for (Field **field=table->field ; *field ; field++)
@@ -684,7 +692,7 @@ int ha_tina::find_current_row(byte *buf)
}
(*field)->store(buffer.ptr(), buffer.length(), system_charset_info);
}
- next_position= (end_ptr - share->mapped_file)+1;
+ next_position= (end_ptr - share->mapped_file)+eoln_len;
/* Maybe use \N for null? */
memset(buf, 0, table->s->null_bytes); /* We do not implement nulls! */