Compare two tables

2005-08-26 Thread Alfredo Cole
Hi:

I need to compare the structure of two tables (fields, field types, field 
lengths, indices, etc.) to determine if they have the same schema, even if 
the fields may be in a different order. Is there a command in mysql that will 
do this? This will be used to determine if the tables are basically the same, 
or if they need to be upgraded based on the table structures of a central 
office.

Thank you.

-- 
Alfredo J. Cole
Grupo ACyC

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



Re: Compare two tables

2005-08-26 Thread Alfredo Cole
El Viernes, 26 de Agosto de 2005 08:16, Martijn Tonies escribió:
 
  You could check the table DDL.
 
  Or use a third party tool, like Database Workbench, that can do this for
  you and even generator a change script. Check www.upscene.com
 
  With regards,
 
  Martijn Tonies
 
Hmmm. No Linux version. Thank you anyway.

-- 
Alfredo J. Cole
Grupo ACyC

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



Re: Compare two tables

2005-08-26 Thread Alfredo Cole
El Viernes, 26 de Agosto de 2005 08:56, Gordon Bruce escribió:
  If you have the 5.0.x version of MySQL then INFROMATION SCHEMA can give
  you what you want. i.e.
 
  SELECT a.*, b.*
  FROM   INFORMATION_SCHEMA.COLUMNS AS a
 INNER JOIN _SCHEMA.COLUMNS AS b
 ON (a.column_name = b.column_name)
  WHERE  a.TABLE_NAME = 'foo_1'
 AND b.TABLE_NAME = 'foo_2'
 
  If you look up INFORMATION SCHEMA in the documentation you will find the
  table definitions to chose the columns you need for your comparison.
 
  21. The INFORMATION_SCHEMA Information Database
  21.1. INFORMATION_SCHEMA Tables
 

This is very interesting. I'm using 4.1.12 as it is the stable version, but I 
will keep an eye on version 5.

Thank you.

-- 
Alfredo J. Cole
Grupo ACyC

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



Accessing a MySQL server from PocketPC

2005-04-30 Thread Alfredo Cole
Hi:

I would like to use the DALP libraries 
(http://solutions.mysql.com/software/?item=145) to access a MySQL server 
4.1.10 on Linux, from my PocketPC (iPAQ 3100 WM 2003 SE). I would appreciate 
it if somebody could provide me with a minimal sample that would just connect 
to a database so I can see what headers need to be included and what 
libraries to link, using eMbedded VC4 and Windows 2000.

Thank you and regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



Re: Develop an application

2005-03-14 Thread Alfredo Cole
El Lun 14 Mar 2005 14:59, Stephen Andert escribió:
 Hi there,

 I searched the archives, but didn't find anything helpful.

 I am trying to build a fairly simple application for contact
 management.  I already have what I want built in MS Access, but I need
 this application to run on Linux.

 I did some searching and Rekall looked like a good tool.  Had a hard
 time getting configure to work and now make is not working right.

 Does anyone have any recommendations for a simple tool for developing
 applications in a Linux world?  The machine in question is currently
 RedHat 9 and I'm not really interested in changing that right now.
(...)

You can try OpenOffice.org.

Regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com


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



How to determine how many ibdata files are needed?

2005-03-11 Thread Alfredo Cole
Using MySQL 4.1.10, SuSE 8.2 Pro, reiser file system.

Hi:

I have been trying to locate a reference which would provide guidelines to 
determine if one ibdata should be used, or when to use several (two, three, 
etc.), but I can not seem to find anything in the manual. I have tried a 
single ibdata file for my 5 Gb database (which is going to grow as history 
gets added to it), two and even three ibdata files, the last with the 
autoextend argument. I have not seen a difference in performance so far.

Is there any advantages to having one single ibdata file, or is it better to 
have several, and if so, how many? If you could point me to a url where I can 
read about this, I would greatly appreciate it.

Thank you and regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



Re: Switching to InnoDB turns out dissapointing

2005-03-02 Thread Alfredo Cole
El Mar 01 Mar 2005 18:29, Heikki Tuuri escribi:
 Alfredo,


I have changed my my.cnf to try and include the suggestions from the list, as 
much as possible and try to run my program again. It now reads like this:

innodb_data_file_path = ibdata1:2G;ibdata2:2G:autoextend
set-variable = innodb_buffer_pool_size=256M
set-variable = innodb_additional_mem_pool_size=32M
set-variable = innodb_log_file_size=64M
set-variable = innodb_log_buffer_size=8M
innodb_flush_log_at_trx_commit=1
set-variable = innodb_lock_wait_timeout=50

The MyISAM database is 1Gb in size, and the resulting InnoDB table space is 4 
Gb.

In my laptop (I have to test here before I decide to implement in the server), 
the time has dropped from 4 hours to 70 minutes. With MyISAM tables, it takes 
12 minutes. Although the reduction in time is substantial, I still think it 
should be better. InnoDB is supposed to provide transactions and row level 
locking, which I need to improve concurrency, without compromising the speed 
of MySQL. We have other processes that need to be run on a weekly basis that 
do a lot (45,000 records need to be examined) of select sum() for a one year 
period, from a table with 1 million+ rows and then updates a table with 
800,000 rows, and so far it takes around 12 hours, even after enclosing 
between BEGIN and COMMIT statements. Could be entirely our fault. Have to 
check that too. Will try with this new setup and see how it goes.

Thank you all.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



Re: Switching to InnoDB turns out dissapointing

2005-03-02 Thread Alfredo Cole
El Mié 02 Mar 2005 11:41, Brent Baisley escribió:
 Coming in late on this thread. The testing on your laptop, are you just
 running the one query or are you somehow emulating the typical load you
 are trying to design for? As you said, you are trying to improve
 concurrency, so you'll need to compare MyISAM and InnoDB setups under
 load (i.e. the weekly run+typical activity).

 If the concurrency you are trying to improve is caused by your weekly
 runs, I would try doing replication. Your summarization queries would
 run against the replicated machine and create a text file for batch
 import/update into the table you need to update. That way you remove
 the load from the main machine caused by the summary queries.


Thank you, Brent. Actually, there are three servers involved, all with a 
similar configuration:

Server 1 - 2 Xeon 2.4 Ghz HT with 4 Gb RAM and three 36 GB SCSI HD's 10K in 
RAID 5 holding the main database. Uses a openMosix kernel.
Server 2 - Identical config used for replication. All selects are run against 
this server.
Server 3 - Same config except for 8 Gb RAM. Acts as an application server 
running the ERP software and acting as connection via a NX server for 200+ 
users.

The servers must be available on a 24/7 basis, and are never brought down 
except for routine maintenance, at which time their roles are switched 
temporarily.

Running the application that updates database structures, when needed, must be 
done before 7:00 am because customers begin to come in at 8:00 am, and should 
not last for more than 30 minutes. We are using MyISAM tables and they have 
to be locked when beeing updated by concurrent users, like salesmen invoicing 
customers in real time (it's a hardware store/True Value convenience chain of 
9 stores all running our server-based ERP). We have setup another database 
and parallel version of our ERP software with InnoDB tables for testing, and 
we are encountering this problem. With MyISAM tables, locking them causes 
some terminals to wait for up to one minute at peak hours, which seems like 
an eternity when a customer is waiting for his invoice to go and pay, get his 
merchandise and leave. This we are hoping to improve with row level locking. 
Inventory, AR, GL, etc. are updated in real time. However, statistics such as 
history sales, sales forecasting, average discounts, profit margins, EOQ, 
DRP, etc. are calculated on a weekly basis moving the period to always hold a 
year's worth of data, using something like:

select sum(sales_value) from invoices where invoice_date=datesub(now(), 
interval 12 month)

The total items in inventory is 45,000 and the invoices table has about 1 
million rows. The system was started January 2004.

In my laptop I can only run single processes, but that's where I test before 
making software, data, and configuration changes in the servers. Compiling 
changes to the software (our own ERP) must also be made in my laptop, turned 
into an rpm file and then installed in the application server (Server 3).

Best regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



Re: Switching to InnoDB turns out dissapointing

2005-03-02 Thread Alfredo Cole
El Mié 02 Mar 2005 16:04, escribió:
 H, sounds like you are trying to mix OLTP and OLAP in one database
 structure. That's a tough one. You want your tables designed to always
 accept data in real time, but once the data is in, it doesn't change
 and you want to query it. Relational vs. Dimensional data models.

 Your hardware is pretty good. Sorry, I missed the early thread
 responses, did you figure out where things are bottlenecking (CPU, Disk
 I/O, RAM, Network)? That will help you focus on what you can change in
 your software if you can't upgrade your hardware.

 The first place to always look is your queries. Optimizing your queries
 always gives you the best bang for you buck. Use explain to make sure
 MySQL is using the right indexes, especially since you are using date
 ranges. Sometimes MySQL may use the best index, sometimes it won't,
 simply by changing the date range. It won't hurt to use hints (USE,
 FORCE, IGNORE) in your query if you know you want MySQL to use a
 certain index.
 You could possible also change you structure slightly, like add a
 WeekNumber column. It could just be an incrementing week number with
 1/1/2004 being week 1, 1/1/2005 being week 53, etc. So it would be
 weeks since 1/1/2004. It could be just a regular int type, which should
 be quicker than searching on a date field. The idea is to add constants
 on entry to speed up the summaries. Also, try to eliminate any and all
 calculations from your query, like replace datesub(now(), interval 12
 month) with a constant. Which means figuring out the right date before
 hand.

 Would you be able to run daily summaries? Then your weekly summaries
 are just running against 7 records.

 1 million rows is not that big, so you should be able to get good
 performance, it's just a matter of structuring things correctly.

 Heck, it may end up that the best thing to do is an insert  select into
 another table (maybe even a temp table), which you then run your
 summaries against. Since your dump is sequential access to disk (the
 same order the data was entered), it may be very quick.

After some thought, and seeded by the many fine suggestions from the list, I 
decided to restructure completely the approach to the problem. The result is 
that the query to calculate one variable now takes only 7 minutes! We will go 
on and restructure the remaining 10 variables and see how it goes. Sometimes, 
not working makes you more productive ;-)

Thank you all and best regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



Switching to InnoDB turns out dissapointing

2005-03-01 Thread Alfredo Cole
Hi:

I have switched from MyISAM tables to InnoDB, using MySQL 4.1.10 under SuSE 
8.2.

My application, an ERP system developed in-house, uses 70 tables, the largest 
one holding a little over one million rows. To assist when changing table 
structures, we developed a software that creates a new table for each of the 
70 tables, one at a time, using the new structure, copies all of the records 
from the old table to the new one, drops the old one and renames the new one.

Using MyISAM tables, this process takes 10 minutes using a two Xeon 2.4 Ghz 
server, with 4 Gb RAM and SCSI RAID 5 disks. The same system takes 2 1/2 
hours using InnoDB tables with the same configuration. We have followed the 
guidelines for tuning the server, and still, we find this to be excessive. 
Can somebody point to some docs, guidelines or web sites we can consult to 
improve InnoDB's performance? It seems inserting many rows decreases 
performance significantly.

Thank you and regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



Re: Switching to InnoDB turns out dissapointing

2005-03-01 Thread Alfredo Cole
El Mar 01 Mar 2005 17:32, Gary Richardson escribió:
 What have you actually done to 'tune' the server? How are you doing
 the inserts?

 InnoDB uses transactions. If you are doing each row as a single
 transaction (the default), it would probably take a lot longer.

 I assume you're doing your copying as a INSERT INTO $new_table SELECT
 * FROM $old_table. Try wrapping that in a
   BEGIN;
   INSERT INTO $new_table SELECT * FROM $old_table;
   COMMIT;

 How do you have your table space configured?

 Just some random thoughts..

This is the InnoDB related stuff from my.cnf:

innodb_data_file_path = ibdata1:10M:autoextend
set-variable = innodb_buffer_pool_size=192M
set-variable = innodb_additional_mem_pool_size=32M
set-variable = innodb_log_file_size=5M
set-variable = innodb_log_buffer_size=32M
innodb_flush_log_at_trx_commit=0
set-variable = innodb_lock_wait_timeout=50

I am using the syntax as you describe it. In my notebook, with 512M RAM, it 
takes 4 hours to complete.

The top command says mysqld is using about 8% of CPU, so it must be a disk 
problem. Funny thing is, it did not show when the tables were MyISAM.

Thank you and regards.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



mysql-query-browser and SuSE 8.2

2005-02-01 Thread Alfredo Cole
Hi:

I have not been able to find a precompiled version of mysql-query-browser for 
SuSE 8.2, either at mysql web site, or using google. Compiling from source 
fails because of version differences in libxml-2.0, for instance. Anybody 
know of a URL where I can find a version that will work with SuSE 8.2?

Thank you.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom - www.acycdomains.com

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



MySQL 4.0 and concat

2004-10-11 Thread Alfredo Cole
Hi:

I have a problem in that all statements that include concat execute very 
slowly. For instance, if I have three fields in string format  that represent 
a year, month and day, and want to issue a select like:

select * from cxcmanpag where contact 
(year,month,day)=stringYear+stringMonth+stringDay (simplified), then it will 
take a long time, againts a table with only around 100,00 records. If I 
rewrite the statement to read:

select * from cxcmanpag where year=stringYear and month=stringMonth and 
day=stringDay, it will execute considerable faster, but will not produce the 
same results.

I have looked in the manual, and also read High Performance MySQL from Zawodny 
and Balling, and MySQL from Paul Dubois, but none of them seem to address 
this issue.

Can somebody point me to a URL or book that I should be reading to improve, 
this, or how to avoid using concat altogether?

Thank you.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom

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



Fwd: Re: MySQL 4.0 and concat

2004-10-11 Thread Alfredo Cole
Sorry. This should have gone back to the list.

--  Mensaje reenviado  --

Subject: Re: MySQL 4.0 and concat
Date: Lun 11 Oct 2004 11:37
From: Alfredo Cole [EMAIL PROTECTED]
To: [EMAIL PROTECTED]

El Lun 11 Oct 2004 08:35, escribió:
 Have you considered NOT comparing dates as strings but rather as date
 values?  That will avoid the use of CONCAT() completely.

I will try this. But there will always be times when using concat might be
required. It would be nice to know if there is a solution to the concat
problem.

Thank you, and regards.

--
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom

---

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom

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



temporary tables and replication

2004-09-01 Thread Alfredo Cole
Hi:

I'm using MySQL 4.0, and have setup replication with one server and one slave, 
both running LM 9.1. My application creates a temporary table on the master, 
which is supposed to be deleted when the connection is closed. When that 
happens, replication stops with the following message:

ERROR: 1051  Unknown table 'tmpclisal'
040831 20:16:38  Slave: error 'Unknown table 'tmpclisal'' on query 
'DROP /*!40005 TEMPORARY */ TABLE truepos.tmpclisal', error_code=1051
040831 20:16:38  Error running query, slave SQL thread aborted. Fix the 
problem, and restart the slave SQL thread with SLAVE START. We stopped at 
log 'central-bin.001' position 12475966

Is there a problem in using temporary tables and replication? I have not found 
any clues in the manual. If there is a problem, perhaps someone can point to 
a url where I can find a solution?

Thank you.

-- 
Alfredo J. Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com - SolCom

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



Re: Help, slave wont stay running!

2004-08-12 Thread Alfredo Cole
El Jueves, 12 de Agosto de 2004 09:22, matt ryan escribió:
 I cant keep the slave up for more than 10 minutes

 constantly getting these errors

 040812 10:32:25  Error reading packet from server: binlog truncated in
 the middle of event (server_errno=1236)
 040812 10:32:25  Got fatal error 1236: 'binlog truncated in the middle
 of event' from master when reading data from binary log
 040812 10:32:25  Slave I/O thread exiting, read up to log
 'FINANCE-bin.185', position 284963878

I had a similar situation one week ago. Found one of the tables (MyISAM) had a 
corrupt index. After fixing it, everything was fine again.

Regards.

-- 
Alfredo Cole
Grupo ACyC
www.acyc.com - www.clshonduras.com

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



Re: Using MySQL and OpenMosix

2004-05-08 Thread Alfredo Cole
El Vie 07 May 2004 00:20, escribió:
(...)

 My knowledge of OpenMosix is extremely limited.  I've not heard of
 anyone successfully using MySQL with OpenMosix for fail-over.  That
 doesn't mean it hasn't been done, but it'd be news to me.

 I assume you've also asked on the relevant OpenMosix list(s).  One
 would hope they'd know.  But maybe not.

 Jeremy

This is the reply I got from Moshe Bar (OpenMosix developer):

***
Even if threads of an application can't migrate, other processes (which eat
up resources away from the application in question) can migrate away and
therefore speed up the application. 

I can't stress enough that it is not the migration that speeds up the
applications, it's the load balancing that increases throughput.


Moshe
***

So there may be hope. I will setup two computers with OM next week and see 
what I can do with them. Thank you and regards.

-- 
Alfredo J. Cole
http://www.acyc.com
http://www.clshonduras.com
[EMAIL PROTECTED]


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



Using MySQL and OpenMosix

2004-05-06 Thread Alfredo Cole
Hi:

I would like to add an identical server to the one I already have: Double Xeon 
processors, 4 Gb RAM and RAID 5 (Hardware) HD's. I would also like to cluster 
them using OpenMosix, but I'm told that MySQL 4.0 will not take advantage of 
the cluster. Is there a way to cluster MySQL so that queries will migrate to 
the new node when needed? Is there any docs I could dig into to see if this 
can be done? Books, how-to's?

Any help would be appreciated. Thank you.

-- 
Alfredo J. Cole
http://www.acyc.com
http://www.clshonduras.com
[EMAIL PROTECTED]


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



Re: Using MySQL and OpenMosix

2004-05-06 Thread Alfredo Cole
El Jue 06 May 2004 11:05, escribió:
 On Thu, May 06, 2004 at 06:55:38AM -0600, Alfredo Cole wrote:
  Hi:
 
  I would like to add an identical server to the one I already have: Double
  Xeon processors, 4 Gb RAM and RAID 5 (Hardware) HD's. I would also like
  to cluster them using OpenMosix, but I'm told that MySQL 4.0 will not
  take advantage of the cluster. Is there a way to cluster MySQL so that
  queries will migrate to the new node when needed? Is there any docs I
  could dig into to see if this can be done? Books, how-to's?

 At the time I wrote Chapter 8 of High Performance MySQL, I tried to
 discuss the available options:

   http://www.oreilly.com/catalog/hpmysql/toc.html

 However, some of the commercial information was hard to come by, so if
 you're looking at those, you may need to discuss with the vendors too.

 Jeremy

Jeremy:

I have ordered your book from Amazon.com. But I am not planning to use a 
commercial solution. I want to use OpenMosix, which is released under the 
GPL. Any suggestions would be welcome.

Thank you.

-- 
Alfredo J. Cole
http://www.acyc.com
http://www.clshonduras.com
[EMAIL PROTECTED]


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



Re: MySQL 4 goes to sleep with table locks?

2004-02-07 Thread Alfredo Cole
El Sáb 07 Feb 2004 02:28, escribió:
 Mr. Alfredo
 Pls, will you give the complete structure as 'create query' of your
 database? that will help us to solve your problem.
 Pradap

This is the structure of the table that holds the sequential numbers for 
various documents that need them:

CREATE TABLE `invcorr` (
  `empresa` tinyint(2) unsigned zerofill NOT NULL default '00',
  `tienda` tinyint(2) unsigned zerofill NOT NULL default '00',
  `ultfac` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultfaccred` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultconsig` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultdev` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultped` bigint(9) unsigned zerofill NOT NULL default '0',
  `ulting` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultapar` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultcoti` bigint(9) unsigned zerofill NOT NULL default '0',
  `ulttras` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultreq` bigint(9) unsigned zerofill NOT NULL default '0',
  `ultajus` bigint(9) unsigned zerofill NOT NULL default '0',
  `timestamp` timestamp(14) NOT NULL,
  `usuario` varchar(20) default NULL,
  PRIMARY KEY  (`empresa`,`tienda`)
) TYPE=MyISAM; 

The condensed extract of the C program tha does the locking is as follows:

SQLinst = lock tables invcorr write, invfacturas write;
state = mysql_query(connection, SQLinst);
if(state != 0)
{
wxMessageBox(mysql_error(mysql), Error:, wxOK | 
wxICON_EXCLAMATION, 
this);
wxMessageBox(_(Could not lock table!), _(Error:), wxOK | 
wxICON_EXCLAMATION, this);
return;
}
SQLinst = select ultfac from invcorr where empresa='
+ sCodigoEmp
+ ' and tienda='
+ sFacTienda
+ ' order by tienda;
state = mysql_query(connection, SQLinst);
result = mysql_store_result(connection);
if(mysql_num_rows(result) != 0) // Tiene registros
{
while((row = mysql_fetch_row(result)) != NULL)
{
// Asigno valores
sFacDocu = row[0] ? row[0] : ;
}
}
mysql_free_result(result);
sFacDocu.ToDouble(dFacDocu);
dFacDocu++;
sFacDocu.Printf(%09.0f, dFacDocu);
SQLinst = update invcorr set ultfac='
+ sFacDocu
+ ' where empresa='
+ sCodigoEmp
+ ' and tienda='
+ sFacTienda + ';
state = mysql_query(connection, SQLinst);
SQLinst = unlock tables;
state = mysql_query(connection, SQLinst);

This final update is what seems to sleep and not react inmediately. The 
application resides in one central server with dual Xeon 2.8 Ghz CPU's and 6 
Gb RAM. All users run the application at the server connecting either via 
ssh, VNC or Linux Terminal Server Project.

During the day, I will get 3 or 4 duplicate numbers per store. Given the fact 
that reporting sales tax received, depends on a correct sequence of invoices, 
my company could get into big trouble if authorities think we are trying to 
avoid sales tax reporting.

Thank you for your help.

-- 
Alfredo J. Cole
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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



MySQL 4 goes to sleep with table locks?

2004-02-06 Thread Alfredo Cole
I am using Mandrake 9.1 and MySQL 4.0.11 from the LM CD's.

In my application, I have a table that stores the sequential numbers of 
invoices prepared by several stores. Every time a salesman prepares an 
invoice for a customer, the system goes to this table, locks it with lock 
tables table write, reads the number of the last invoice made for that 
store, adds one to that number, updates the field, and unlocks the table. In 
theory, I should never get a duplicate invoice, but in practice, I do. So, it 
seems that MySQL maintains, under some special circumstances, the same number 
and does not update it. Maybe there is a parameter in my.cnf I could change 
to make sure all updates are processed inmediately?

Auto increment field would not apply in this case, since there is only one 
record per store that gets updated for every invoice. I would appreciate any 
advise. Thank you.

-- 
Alfredo J. Cole
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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



Too many connections

2004-01-16 Thread Alfredo Cole
I'm using mysql 3.23.55 and Linux Mandrake 9.1. I have about 60 users 
connecting to mysql using our accounting system. The users get some times a 
Too many connections error. I have set max_connections at 200, and the 
system opens only one connection per user at start up. Can somebody indicate 
where to look to calculate this value and eliminate this error?

Thank you.

-- 
Alfredo J. Cole
http://www.acyc.com
http://www.clshonduras.com
[EMAIL PROTECTED]


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



Re: select lock - How reliable?

2004-01-09 Thread Alfredo Cole
El Jue 08 Ene 2004 19:56, Paul DuBois escribió:
 At 19:16 -0600 1/8/04, Alfredo Cole wrote:
 Hi:
 
(...)
 The code I use is:
 
 select lock
 

Sorry. It's select get_lock...

 get code
 add one to code
 write code
 
 release lock

and select release_lock...


 That looks like pseudo code (There is no SELECT LOCK statement), so it's
 difficult to say what this should do.

 I have tried lock tables / unlock tables and it will eventually deadlock,
  even though the manual says it's guaranteed not to happen.

 That's right.  If you deadlock with table locks on MyISAM tables, something
 odd is going on.

 But, given the nature of what you *appear* to want (get the next code in
 sequence), I'm curious why you don't just use an AUTO_INCREMENT column
 and use LAST_INSERT_ID() to retrieve the value.  Is there something unusual
 about your requirements?

I have not tried this. I was afraid that concurrency would in some cases cause 
it to return the wrong code. If two users access the table at the same time, 
which code would each one get? The one that the last user inserted, or the 
correct one for the first user, and so forth?

Thank you.

-- 
Alfredo J. Cole
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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



select lock - How reliable?

2004-01-08 Thread Alfredo Cole
Hi:

I have an application that is used by around 40 users who need to access a 
table, obtain a sequential code, and write it back. I'm using MyISAM tables, 
and mysql 3.23 running under LM 9.0.

A couple of times during the day, the users get the same code, and that is 
causing us many problems.

The code I use is:

select lock

get code
add one to code
write code

release lock

I have tried lock tables / unlock tables and it will eventually deadlock, even 
though the manual says it's guaranteed not to happen.

I would appreciate a suggestion as to where I can read more about locking 
tables / records using MySQL and My ISAM tables.

Thank you.

-- 
Alfredo J. Cole
[EMAIL PROTECTED]
[EMAIL PROTECTED]


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



Re: Yet another server vendor inquiry

2003-09-08 Thread Alfredo Cole
El Lunes, 8 de Septiembre de 2003 09:01, Michael Bacarella escribió:
 Names of vendors who are happy to provide servers
 applicable for high load Linux/MySQL.  Willing to
 do custom configurations.

 Anyone?

 --
 Michael Bacarella24/7 phone: 1-646-641-8662
 Netgraft Corporation   http://netgraft.com/

 Finger email address for public key.  Key fingerprint:
   C40C CB1E D2F6 7628 6308  F554 7A68 A5CF 0BD8 C055

Try:

www.calforniadigital.com
www.monarchcomputer.com

Regards.

-- 
Alfredo J. Cole
http://www.acyc.com
http://www.clshonduras.com


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



Using MySQL with Mingw32

2002-03-14 Thread Alfredo Cole

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Hi:

I'm using MySQL 3.2.3.39 for Win98.

Has anybody been able to develop applications using Mingw32 compiler? 
If so, where can I get a version of the libmysqlclient library that 
will work with this compiler?

Thank you.

- -- 
Alfredo J. Cole
http://www.acyc.com (Accounting Systems)
http://www.clshonduras.com (Linux Hardware)
PGP Key available from certserver.pgp.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.5 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8kOWAu5DxuPWE298RAss1AJ99zdbTZHb4Nlc6ED++J6WsQu9+UgCfX/vZ
EB+WU6RiQYPZLVJot6s8oHw=
=WMmW
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: [mysql] DBF a MySql

2001-11-16 Thread Alfredo Cole

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

El Viernes 16 Noviembre 2001 08:23, escribiste:
 Hola a todos.
 Alguien tiene una herramienta para exportar tablas dbf a MySql?

 saludos
 Gastón


Puedes usar dbf2mysql. Saludos.

- -- 
Alfredo J. Cole
Tegucigalpa, D. C., Honduras
http://www.acyc.com (Accounting Systems)
http://www.clshonduras.com (Linux Hardware)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE79Sp1u5DxuPWE298RAiUeAJ9PKXAnrI2Kp0PMdxpm5S90jwIzkQCeOUwA
htF9sy72pp63SeA3nd8Aq88=
=BPxZ
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: About huge numbers

2001-11-15 Thread Alfredo Cole

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

El Jueves 15 Noviembre 2001 13:15, escribiste:
 Gyulay Gabor wrote:
  The problem is that I need to store numbers with lot more
  than 16 decimal digits - e.g. 1234567890123456789012345.12
  [...]
 
  The reason is why we need this that there're several
  currencies (like italian lire) which requires this kind of
  precision.

 Excellent answer from Carl.

 Generally, you don't want to store currencies in floating point,
 anyway, and it's unfortunate that MySQL implements DECIMAL as
 floating point rather than a variable-length BCD (which is exact).

The manual defines DECIMAL as an exact numeric data type (page 
141), since it stores the number as a string, preserving its 
exactness. How you manipulate this number inside your program is 
another story, and this may be the cause of confusion. I program 
accounting systems and always use at least a double. Unfortunately, 
BCD math is not available for all compilers (Borland is where I saw 
it last).

- -- 
Alfredo J. Cole
Tegucigalpa, D. C., Honduras
http://www.acyc.com (Accounting Systems)
http://www.clshonduras.com (Linux Hardware)
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE79ByQu5DxuPWE298RAg7wAJ0VEmTKBAqRR8id4P5GtTcujm4qwgCeNKnI
mGE8Qs1eZUAMK1RuztZCvc4=
=KRNI
-END PGP SIGNATURE-

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: foxpro conversion

2001-11-14 Thread Alfredo Cole

El Miércoles 14 Noviembre 2001 09:00, escribiste:
 Anybody have any tools/tips for converting  a foxpro database to
 mysql

 ___
 Sean O'Donnell

Try dbf2mysql. It works for me.

-- 
Alfredo J. Cole
Tegucigalpa, D. C., Honduras
http://www.acyc.com (Accounting Systems)
http://www.clshonduras.com (Linux Hardware)

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: DBF to MySQL Problem?

2001-08-21 Thread Alfredo Cole

El Martes 21 Agosto 2001 15:23, escribiste:
 Hello,

 I have downloaded your dbf2mysql-1.14.tar file from the
 MySQL.com site. I read through the README and still
 cannot seem to get this to work.  Here is the error I'm
 getting:

 [info:admin/Desktop/dbf2mysql-1.14] root# make
 /usr/bin/cc -O2 -Wall -DVERSION=\1.14\ -I/usr/local/
 mysql -c -o dbf2mysql.o dbf2mysql.c
 dbf2mysql.c:19: header file 'mysql.h' not found

Do you the mysql-devel package installed?

-- 
Alfredo J. Cole
[EMAIL PROTECTED]
Tegucigalpa, D. C., Honduras

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php