| 1010 | ****************************************************************************/ |
| 1011 | |
| 1012 | static int |
| 1013 | read_fixed_length(THD *thd, COPY_INFO &info, TABLE_LIST *table_list, |
| 1014 | List<Item> &fields_vars, List<Item> &set_fields, |
| 1015 | List<Item> &set_values, READ_INFO &read_info, |
| 1016 | ulong skip_lines, bool ignore_check_option_errors) |
| 1017 | { |
| 1018 | List_iterator_fast<Item> it(fields_vars); |
| 1019 | Item *item; |
| 1020 | TABLE *table= table_list->table; |
| 1021 | bool err= false, progress_reports; |
| 1022 | ulonglong counter, time_to_report_progress; |
| 1023 | DBUG_ENTER("read_fixed_length"); |
| 1024 | |
| 1025 | counter= 0; |
| 1026 | time_to_report_progress= MY_HOW_OFTEN_TO_WRITE/10; |
| 1027 | progress_reports= 1; |
| 1028 | if ((thd->progress.max_counter= read_info.file_length()) == ~(my_off_t) 0) |
| 1029 | progress_reports= 0; |
| 1030 | |
| 1031 | Write_record write(thd, table, &info, NULL); |
| 1032 | |
| 1033 | while (!read_info.read_fixed_length()) |
| 1034 | { |
| 1035 | if (thd->killed) |
| 1036 | { |
| 1037 | thd->send_kill_message(); |
| 1038 | DBUG_RETURN(1); |
| 1039 | } |
| 1040 | if (progress_reports) |
| 1041 | { |
| 1042 | thd->progress.counter= read_info.position(); |
| 1043 | if (++counter >= time_to_report_progress) |
| 1044 | { |
| 1045 | time_to_report_progress+= MY_HOW_OFTEN_TO_WRITE/10; |
| 1046 | thd_progress_report(thd, thd->progress.counter, |
| 1047 | thd->progress.max_counter); |
| 1048 | } |
| 1049 | } |
| 1050 | if (skip_lines) |
| 1051 | { |
| 1052 | /* |
| 1053 | We could implement this with a simple seek if: |
| 1054 | - We are not using DATA INFILE LOCAL |
| 1055 | - escape character is "" |
| 1056 | - line starting prefix is "" |
| 1057 | */ |
| 1058 | skip_lines--; |
| 1059 | continue; |
| 1060 | } |
| 1061 | it.rewind(); |
| 1062 | uchar *pos=read_info.row_start; |
| 1063 | #ifdef HAVE_valgrind |
| 1064 | read_info.row_end[0]=0; |
| 1065 | #endif |
| 1066 | |
| 1067 | restore_default_record_for_insert(table); |
| 1068 | while ((item= it++)) |
| 1069 | { |
no test coverage detected