Re: out of memory error and update problem

2004-03-25 Thread gerald_clark


Chip Wiegand wrote:

When running mysql from the command line (Putty terminal) and trying to do 
some updates the updates fail. First the query I am running -

mysql> update warranty_temp, warranty_old set 
warranty_old.OwnerName=warranty_temp.OwnerName where 
warranty_old.WarrantyID between 75 and 100 AND warranty_temp.WarrantyID 
between 75 and 100;
Query OK, 119 rows affected (50.97 sec)
Rows matched: 14641  Changed: 119  Warnings: 0
 

This is not a join, it is a cartesian product of the 2 table ranges.

The results of this query are that the OwnerName in record 75 is copied 
into the OwnerName for records 75 thru 100. That shouldn't be, there 
should be a differant OwnerName for each row being copied into each row of 
the target table. Now the table has 119 rows with the same OwnerName.

 

mysql> update warranty_temp, warranty_old set 
warranty_old.OwnerName=warranty_temp.OwnerName where
warranty_old.WarrantyID=warranty_temp.WarrantyID and 
warranty_old.WarrantyID between 75 and 100 ;





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]


out of memory error and update problem

2004-03-24 Thread Chip Wiegand
When running mysql from the command line (Putty terminal) and trying to do 
some updates the updates fail. First the query I am running -

mysql> update warranty_temp, warranty_old set 
warranty_old.OwnerName=warranty_temp.OwnerName where 
warranty_old.WarrantyID between 75 and 100 AND warranty_temp.WarrantyID 
between 75 and 100;
Query OK, 119 rows affected (50.97 sec)
Rows matched: 14641  Changed: 119  Warnings: 0

The results of this query are that the OwnerName in record 75 is copied 
into the OwnerName for records 75 thru 100. That shouldn't be, there 
should be a differant OwnerName for each row being copied into each row of 
the target table. Now the table has 119 rows with the same OwnerName.

I have also tried -

mysql> update warranty_old, warranty_temp set 
warranty_old.OwnerName=warranty_temp.OwnerName where 
warranty_old.WarrantyID = warranty_temp.WarrantyID;

This copied the OwnerName in row 1 into the OwnerName of every row in the 
table.

Seems the only way to get this to work is to update every row individually 
-

mysql> update warranty, warranty_old set 
warranty.OwnerName=warranty_old.OwnerName where warranty.WarrantyID='39' 
AND warranty_old.WarrantyID='39';

which works, but there are thousands of rows to update.

 Now the memory error - when trying to run a large update, it fails and 
the log file contains this message -

040324 14:36:22  Out of memory;  Check if mysqld or some other process 
uses all
available memory. If not you may have to use 'ulimit' to allow mysqld to 
use more
memory or you can add more swap space

I don't know what 'ulimit' is. The server has 512 megs of swap space,
I opened a second Putty terminal and watched top while running the update 
statements in another window and MySQL uses 95% of the memory while 
processing but the swap never gets touched (shows only 40K used).  The 
server has 768megs ram, 600mhz Athlon processor.

I just checked the dmesg messages and found this -

pid 18729 (mysqld), uid 88 inumber 32818 on /: filesystem full

so I ran this -

su-2.05b# df -H
FilesystemSize   Used  Avail Capacity  Mounted on
/dev/ad0s1a   508M   346M   121M74%/
devfs 1.0K   1.0K 0B   100%/dev
/dev/ad0s1d14G   2.9G   9.9G22%/usr

File system is not full, what's it talking about?

What would be the recommended remedies?
--
Chip Wiegand
Computer Services
Simrad, Inc
www.simradusa.com
[EMAIL PROTECTED]

"There is no reason anyone would want a computer in their home."
 --Ken Olson, president, chairman and founder of Digital Equipment 
Corporation, 1977
 (Then why do I have 8? Somebody help me!)

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]