Bug #49619 ERROR 1261 (01000): Row 1 doesn't contain data for all columns in Windows
Submitted: 11 Dec 2009 11:44 Modified: 11 Dec 2009 15:20
Reporter: Mirko Gamerman Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:5.4.3 OS:Windows
Assigned to: CPU Architecture:Any

[11 Dec 2009 11:44] Mirko Gamerman
Description:
Command-line client:
C:\TempMNT>mysql --version
C:\TEMPMNT\MYSQL.EXE Ver 14.14 Distrib 5.4.3-beta, for Win32 (ia32)

First: OS Windows:  Server version: 5.4.3-beta-community MySQL Community Server (GPL)
Second: OS FreeBSD: Server version: 5.4.3-beta-log FreeBSD port: mysql-server-5.4.3

ERROR 1261 (01000): Row 1 doesn't contain data for all columns 
in Windows-client -> Windows-server, but all Ok if windows-client -> FreeBsd-server.

How to repeat:
If connect from Command-line client to OS FreeBSD-server (Windows-client -> FreeBSD-server):
mysql> load data local infile 'c:\\tempmnt\\glob.tmp' replace into table glob fi
elds terminated by '\t' lines terminated by '\n';
Query OK, 4 rows affected, 4 warnings (0.11 sec)
Records: 2  Deleted: 2  Skipped: 0  Warnings: 4

If connect from Command-line client to OS Windows: (Windows-client -> Windows-server)
mysql> load data local infile 'c:\\tempmnt\\glob.tmp' replace into table glob fi
elds terminated by '\t' lines terminated by '\n';
ERROR 1261 (01000): Row 1 doesn't contain data for all columns

glob.sql

-- MySQL dump 10.13  Distrib 6.0.11-alpha, for portbld-freebsd7.2 (i386)
--
-- Host: localhost    Database: ksall
-- ------------------------------------------------------
-- Server version	5.4.3-beta-log

/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;

--
-- Table structure for table `glob`
--

DROP TABLE IF EXISTS `glob`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `glob` (
  `descr` tinyint(4) NOT NULL DEFAULT '0',
  `unic` int(11) NOT NULL DEFAULT '0',
  `podcod` char(12) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '000000000000',
  `famil` char(15) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `im` char(15) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `pob` char(15) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `pasp` char(15) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `adresa` char(50) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `domtel` char(7) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `mobtel` char(12) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `arhiv` char(1) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `vstup` date NOT NULL DEFAULT '0000-00-00',
  `data_stv` date NOT NULL DEFAULT '0000-00-00',
  `user` char(10) COLLATE cp1251_ukrainian_ci NOT NULL DEFAULT '',
  `lastupd` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`descr`,`unic`)
) ENGINE=InnoDB DEFAULT CHARSET=cp1251 COLLATE=cp1251_ukrainian_ci;
/*!40101 SET character_set_client = @saved_cs_client */;

/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;

/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

-- Dump completed on 2009-12-10 20:40:14 

'c:\\tempmnt\\glob.tmp' is same
[11 Dec 2009 11:47] Mirko Gamerman
glob.sql

Attachment: glob.sql (application/octet-stream, text), 2.24 KiB.

[11 Dec 2009 12:27] Valeriy Kravchuk
Please, upload that glob.tmp file content. I think this problem can be related to Unix end-of-lines in your file.
[11 Dec 2009 13:08] Mirko Gamerman
glob.tmp

Attachment: GLOB.TMP (application/octet-stream, text), 370 bytes.

[11 Dec 2009 13:12] Mirko Gamerman
File glob.tmp created by DOS-program.
While the version of MySQL-server was 4.1.* it was all good.
[11 Dec 2009 14:57] Peter Laursen
It is happening because of *strict SQL_mode* I believe.

If you have columns defined NOT NULL with no default you cannot do an INSERT not setting such column explicitly with *strict mode* - because nothing is possible as
* no DEFAULT available
* NULL is not allowed
* 'strict mode* prevents/forbids insertion of 0 (zero) or '' (empty string).

Peter
(not a MySQL person)
[11 Dec 2009 15:12] Mirko Gamerman
*strict mode* is good idea!
It's all Ok!
This is not a bug.
Sorry.