How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Hello,

I would like to know how to write directly to MyISAM files, without passing
by SELECT or UPDATE queries.

I believe this info can be found in the files myisam.h and myisammrg.h, but
I am not shure if its safe and 
how to do it. 

I would very much like to have an example of this code (C code).

thank you 

Stéphane.



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



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Good question,

I am not shure if I need to.

Here's why I am asking:

I have a table that does not have a primary key and I need to update only
one row.
This complicates my Update Query since I cannot specify a Where clause.

I did had a primary key RowID (AUTO INCREMENT) to be sble to specify a row
in my query.
But this Field (RowID) can now be seen when I do a SELECT query. I did not
find a
way to hide this field.

So my first question should be : Is there a way to hide a field ??

Best Regards,

Stéphane.

-Original Message-
From: Martijn Tonies [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:22
To: MySQL (E-mail)
Subject: Re: How to READ/WRITE directly on MyISAM data files ?


Hi,

 I would like to know how to write directly to MyISAM files, without
passing
 by SELECT or UPDATE queries.

 I believe this info can be found in the files myisam.h and myisammrg.h,
but
 I am not shure if its safe and
 how to do it.

I guess it will only be safe if you're sure you've got all bugs out, like
in the MySQL engine.

So the question would be: WHY?

With regards,

Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL  MS SQL
Server.
Upscene Productions
http://www.upscene.com


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

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



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Thank you, but I already know the basics of SQL SELECT statements.

What I am trying to say is, if a User writes a SELECT clause, I do not want
him to
see the RowID field. I do not want him to write a long SELECT statement,
especially if my
table has 20 FIELDS or more. (Can you imagine the user writing these queries
all the time).

I want him to be able to write SELECT * FROM ATABLE.

Thank you,

Stéphane.

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:41
To: Stéphane Bischoff; Martijn Tonies; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
So my first question should be : Is there a way to hide a field ??
[/snip]

SELECT only the information you want. Let's say I have

RowID 
Name
Address
City

And I only want Name Address  and City

SELECT Name, Address, City FROM table WHERE RowID = 'foo'
UPDATE table SET Name = 'foo' WHERE RowID = '12'

etcetera

A good book on SQL basics will get you a long way on things like this.

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



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Hello,

Here's an example :


I have a table named Product.

TABLE : PRODUCT
+-+-+-+-+-+
|RowID| Name|  Company| Price   |   Warranty  |

| | | | | |
+-+-+-+-+-+
|   1 |   PC 1000   |  MyCom Inc. |  1000.00|   1 year|

|   2 |   PC 1000   |  MyCom Inc. |  1200.00|   2 year|

|   3 |   PC 1000   |  MyCom Inc. |  1300.00|   3 year|

|   4 |   PC 2000   |  MyCom Inc. |  1200.00|   1 year|

|   4 |   PC 2000   |  MyCom Inc. |  1300.00|   2 year|

|   4 |   PC 2000   |  MyCom Inc. |  1400.00|   3 year|

|   4 |   PC 3000   |  MyCom Inc. |  1500.00|   1 year|

|   4 |   PC 3000   |  MyCom Inc. |  1600.00|   2 year|

|   4 |   PC 3000   |  MyCom Inc. |  1700.00|   3 year|

|   4 |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

|   4 |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

|   4 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

+-+-+-+-+-+

From My Server Side Application (C code)

I can Update my Rows using my RowID.

Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;


But For My Client Side Applications :

User logs in my Client app.
User types in SELECT * FROM product.
User does NOT WANT TO SEE RowID numbers.
User wants to see this output :

+-+-+-+-+
| Name|  Company| Price   |   Warranty  |   
| | | | |
+-+-+-+-+
|   PC 1000   |  MyCom Inc. |  1000.00|   1 year|
|   PC 1000   |  MyCom Inc. |  1200.00|   2 year|   
|   PC 1000   |  MyCom Inc. |  1300.00|   3 year|   
|   PC 2000   |  MyCom Inc. |  1200.00|   1 year|   
|   PC 2000   |  MyCom Inc. |  1300.00|   2 year|   
|   PC 2000   |  MyCom Inc. |  1400.00|   3 year|   
|   PC 3000   |  MyCom Inc. |  1500.00|   1 year|   
|   PC 3000   |  MyCom Inc. |  1600.00|   2 year|   
|   PC 3000   |  MyCom Inc. |  1700.00|   3 year|   
|   PC AR3|  SPCom Inc. |  1200.00|   2 year|   
|   PC AR3|  SPCom Inc. |  1300.00|   3 year|   
|   PC AR4|  SPCom Inc. |  1400.00|   4 year|   
+-+-+-+-+

I know there are ways to bypass this problem, but it involves much more
coding in my Delphi applications
on my Client side.

So my question is, Is there a way to hide a field from select statements.

Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
FROM product
he would get the RowId in his query output.

Best Regards,

Stéphane.


 


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 08:49
To: Stéphane Bischoff; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
Thank you, but I already know the basics of SQL SELECT statements.

What I am trying to say is, if a User writes a SELECT clause, I do not want
him to
see the RowID field. I do not want him to write a long SELECT statement,
especially if my
table has 20 FIELDS or more. (Can you imagine the user writing these queries
all the time).

I want him to be able to write SELECT * FROM ATABLE.
[/snip]

Well, that pretty much misses the point then, doesn't it? Are your records
not unique? There is no way that you can write an update statement that
would perform the operation on the proper record? Can you show us a bit of
the table? With more information we can help.

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



RE: How to READ/WRITE directly on MyISAM data files ?

2003-12-11 Thread Stéphane Bischoff

Just wanted to know if it was possible to hide fields for whatever reason.
Judging by your response, the answer is no.

Therefore, I will look at other alternatives.

Thanks,

-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: 11 décembre, 2003 09:09
To: Stéphane Bischoff; MySQL (E-mail)
Subject: RE: How to READ/WRITE directly on MyISAM data files ?


[snip]
|   4 |   PC AR3|  SPCom Inc. |  1200.00|   2 year|

|   4 |   PC AR3|  SPCom Inc. |  1300.00|   3 year|

|   4 |   PC AR4|  SPCom Inc. |  1400.00|   4 year|

+-+-+-+-+-+

From My Server Side Application (C code)

I can Update my Rows using my RowID.

Example : UPDATE TABLE product SET Price=2000.00 WHERE RowID=3;
[/snip]

Yes, but if you use RowID 4 you'll be updating multiple rows

[snip]
But For My Client Side Applications :

I know there are ways to bypass this problem, but it involves much more
coding in my Delphi applications
on my Client side.
[/snip]

So?

[snip]
So my question is, Is there a way to hide a field from select statements.

Of course, if my user wrote SELECT RowId, Name, Company, Price, Warranty
FROM product
he would get the RowId in his query output.
[/snip]

Does the user know all of the columns? If so, and he chose to see them that
would be his choice, no?

Really, it is just bad database design. Each row should have a unique
identifier.  What is the big deal about the user seeing the RowID?

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



RE: Licence question

2003-12-04 Thread Stéphane Bischoff
Thank you for all your response, but my question is very simple :

Example :

We have company 1 that make's a product that communicate with MySQL server
using TCP/IP.
This product (company 1) does not use the MySQL client to connect to MySQL
server. (Don't ask me how, I don't know)
(By the way, this product really exist, that is why I am asking this
question).

Therefore, if Company 2 has a MySQL server (commercial license) and
purchases 100 product from company 1, 
does company 2 need a 100 MySQL client or driver licenses ???

I believe not (2 reasons)

1 - I paid company 1 for its product.
2 - the product does not use MySQL client to connect to MySQL server.

This is what is bugging me, can you help ?

thank you, 

-Original Message-
From: Ron Albright [mailto:[EMAIL PROTECTED]
Sent: 3 décembre, 2003 18:27
To: [EMAIL PROTECTED]
Subject: Re: Licence question


At 01:26 PM 12/3/2003, Chuck Gadd [EMAIL PROTECTED] wrote:

This is your standard I am not a lawyer type answer, because reading
the text of the GPL can be overwhelming, but the way I understand it,
if you are shipping MySql with your app, then you've either got to
release your app under the GPL, or you've got to buy a commercial
Mysql license for each copy of your app that you ship.

If you were to simply download and install MySQL at your company
office, then write apps for in-house use at your company, then
you have no license issues.  Your apps would not need to be
GPL, and you do not need a Mysql commercial license.

This was discussed by a Mysql AB employee during the MySQL
training class I took a few weeks ago.

This is somewhat ambiguous. From the statements below it would appear to me 
that you can ship MySQL with an application as long as the your application 
does not directly link to the MySQL libraries as would be the case if 
embedded. But mere aggregation seems to apply even if your application 
starts the database as a separate executable. The last paragraph of the 
first question seems to allow shipping it along with your application but 
the last sentence leaves it somewhat open to question.

 From the GPL FAQ (http://www.gnu.org/licenses/gpl-faq.html):


What is the difference between mere aggregation and combining two 
modules into one program?

Mere aggregation of two programs means putting them side by side on the 
same CD-ROM or hard disk. We use this term in the case where they are 
separate programs, not parts of a single program. In this case, if one of 
the programs is covered by the GPL, it has no effect on the other program.

Combining two modules means connecting them together so that they form a 
single larger program. If either part is covered by the GPL, the whole 
combination must also be released under the GPL--if you can't, or won't, do 
that, you may not combine them.

What constitutes combining two parts into one program? This is a legal 
question, which ultimately judges will decide. We believe that a proper 
criterion depends both on the mechanism of communication (exec, pipes, rpc, 
function calls within a shared address space, etc.) and the semantics of 
the communication (what kinds of information are interchanged).

If the modules are included in the same executable file, they are 
definitely combined in one program. If modules are designed to run linked 
together in a shared address space, that almost surely means combining them 
into one program.

By contrast, pipes, sockets and command-line arguments are communication 
mechanisms normally used between two separate programs. So when they are 
used for communication, the modules normally are separate programs. But if 
the semantics of the communication are intimate enough, exchanging complex 
internal data structures, that too could be a basis to consider the two 
parts as combined into a larger program.



If a program released under the GPL uses plug-ins, what are the 
requirements for the licenses of a plug-in.

It depends on how the program invokes its plug-ins. If the program uses 
fork and exec to invoke plug-ins, then the plug-ins are separate programs, 
so the license for the main program makes no requirements for them.

If the program dynamically links plug-ins, and they make function calls to 
each other and share data structures, we believe they form a single 
program, so plug-ins must be treated as extensions to the main program. 
This means they must be released under the GPL or a GPL-compatible free 
software license, and that the terms of the GPL must be followed when those 
plug-ins are distributed.

If the program dynamically links plug-ins, but the communication between 
them is limited to invoking the `main' function of the plug-in with some 
options and waiting for it to return, that is a borderline case.



Can I use the GPL for a plug-in for a non-free program?

If the program uses fork and exec to invoke plug-ins, then the plug-ins are 
separate programs, so the license for the main program makes no 
requirements for them. 

How do I know what my MySQL server IP is ??

2003-12-04 Thread Stéphane Bischoff

Hi,

w do I know what my MySQL server IP is ??

thanks


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



Licence question

2003-12-03 Thread Stéphane Bischoff

Hi,

We are programming a Delphi application that interacts with the MySQL server
from Windows.

Normally we would need a client side licence ?

But if we use a set of components (from a third party) that allow us to
interact with the MySQL server without using the MySQL client. In this case,
do we need to buy a client licence at all ?

Thank you


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