* EOAccess/EOAttribute.m: reformat

* EOAccess/EOAdaptor.m
in databaseEncoding: use +[GSMimeDocument encodingFromCharset:]
less logging
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLChannel.h: reformat
encoding -> _encoding
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLChannel.m
Use _encoding now for reading and writing Strings.
less logging
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLCompatibility.h
if 0 for now (please check if that code is still needed!)
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLPrivate.m
fix header
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLAdaptor.m
less logging
* Apps/EOModelEditor
* Apps/EOModelEditor/Inspectors
propset  svn:ignore
* Apps/EOModelEditor/GNUmakefile
add -lgnustep-baseadd on non-GNUstep



git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gdl2/trunk@30517 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
dwetzel 2010-06-01 00:29:37 +00:00
parent 23ac0bd7bf
commit f96eb5ce06
10 changed files with 178 additions and 298 deletions

View file

@ -41,7 +41,6 @@
// [dc retain];
[EOMEEOAccessAdditions class];
[super finishLaunching];
}

View file

@ -37,9 +37,13 @@ else
EOModelEditor_APPLICATION_ICON = EOModelEditor.tiff
endif
ifneq ($(FOUNDATION_LIB),gnu)
ADDITIONAL_OBJC_LIBS += -lgnustep-baseadd
endif
ADDITIONAL_INCLUDE_DIRS+=-I../
ADDITIONAL_NATIVE_LIB_DIRS+=../EOAccess ../EOControl ../EOInterface ../EOModeler
ADDITIONAL_NATIVE_LIBS += EOAccess EOControl EOModeler Renaissance
ADDITIONAL_NATIVE_LIBS += EOAccess EOControl EOModeler Renaissance
$(APP_NAME)_RESOURCE_FILES = \
Resources/ModelDrag.tiff \

View file

@ -1,3 +1,26 @@
2010-05-30 David Wetzel <dave@turbocat.de>
* EOAccess/EOAttribute.m: reformat
* EOAccess/EOAdaptor.m
in databaseEncoding: use +[GSMimeDocument encodingFromCharset:]
less logging
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLChannel.h: reformat
encoding -> _encoding
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLChannel.m
Use _encoding now for reading and writing Strings.
less logging
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLCompatibility.h
if 0 for now (please check if that code is still needed!)
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLPrivate.m
fix header
* EOAdaptors/PostgreSQLAdaptor/PostgreSQLAdaptor.m
less logging
* Apps/EOModelEditor
* Apps/EOModelEditor/Inspectors
propset svn:ignore
* Apps/EOModelEditor/GNUmakefile
add -lgnustep-baseadd on non-GNUstep
2010-05-30 David Wetzel <dave@turbocat.de>
* Apps/EOModelEditor
* Apps/EOModeler

View file

@ -9,6 +9,9 @@
Author: Mirko Viviani <mirko.viviani@gmail.com>
Date: February 2000
Author: David Wetzel <dave@turbocat.de>
Date: 2010
$Revision$
$Date$
@ -59,6 +62,7 @@ RCS_ID("$Id$")
#include <Foundation/NSData.h>
#include <Foundation/NSSet.h>
#include <Foundation/NSDebug.h>
#include <Foundation/GSMime.h>
#else
#include <Foundation/Foundation.h>
#endif
@ -66,6 +70,7 @@ RCS_ID("$Id$")
#ifndef GNUSTEP
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/NSDebug+GNUstepBase.h>
#include <GNUstepBase/GSMime.h>
#endif
#include <GNUstepBase/Unicode.h>
@ -95,49 +100,6 @@ NSString *EOConnectionDictionaryKey = @"EOConnectionDictionaryKey";
NSString *EOAdministrativeConnectionDictionaryKey
= @"EOAdministrativeConnectionDictionaryKey";
/* This mapping should be kept in sync with NSStringEncoding in NSString.h. */
static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
{ @"NSASCIIStringEncoding", NSASCIIStringEncoding },
{ @"NSNEXTSTEPStringEncoding", NSNEXTSTEPStringEncoding },
{ @"NSJapaneseEUCStringEncoding", NSJapaneseEUCStringEncoding },
{ @"NSUTF8StringEncoding", NSUTF8StringEncoding },
{ @"NSISOLatin1StringEncoding", NSISOLatin1StringEncoding },
{ @"NSSymbolStringEncoding", NSSymbolStringEncoding },
{ @"NSNonLossyASCIIStringEncoding", NSNonLossyASCIIStringEncoding },
{ @"NSShiftJISStringEncoding", NSShiftJISStringEncoding },
{ @"NSISOLatin2StringEncoding", NSISOLatin2StringEncoding },
{ @"NSUnicodeStringEncoding", NSUnicodeStringEncoding },
{ @"NSWindowsCP1251StringEncoding", NSWindowsCP1251StringEncoding },
{ @"NSWindowsCP1252StringEncoding", NSWindowsCP1252StringEncoding },
{ @"NSWindowsCP1253StringEncoding", NSWindowsCP1253StringEncoding },
{ @"NSWindowsCP1254StringEncoding", NSWindowsCP1254StringEncoding },
{ @"NSWindowsCP1250StringEncoding", NSWindowsCP1250StringEncoding },
{ @"NSISO2022JPStringEncoding", NSISO2022JPStringEncoding },
{ @"NSMacOSRomanStringEncoding", NSMacOSRomanStringEncoding },
#if defined(GNUSTEP_BASE_LIBRARY) || OS_API_VERSION(GS_API_NONE,MAC_OS_X_VERSION_10_5)
{ @"NSProprietaryStringEncoding", NSProprietaryStringEncoding },
#endif
{ @"NSKOI8RStringEncoding", NSKOI8RStringEncoding },
{ @"NSISOLatin3StringEncoding", NSISOLatin3StringEncoding },
{ @"NSISOLatin4StringEncoding", NSISOLatin4StringEncoding },
{ @"NSISOCyrillicStringEncoding", NSISOCyrillicStringEncoding },
{ @"NSISOArabicStringEncoding", NSISOArabicStringEncoding },
{ @"NSISOGreekStringEncoding", NSISOGreekStringEncoding },
{ @"NSISOHebrewStringEncoding", NSISOHebrewStringEncoding },
{ @"NSISOLatin5StringEncoding", NSISOLatin5StringEncoding },
{ @"NSISOLatin6StringEncoding", NSISOLatin6StringEncoding },
{ @"NSISOThaiStringEncoding", NSISOThaiStringEncoding },
{ @"NSISOLatin7StringEncoding", NSISOLatin7StringEncoding },
{ @"NSISOLatin8StringEncoding", NSISOLatin8StringEncoding },
{ @"NSISOLatin9StringEncoding", NSISOLatin9StringEncoding },
{ @"NSGB2312StringEncoding", NSGB2312StringEncoding },
{ @"NSUTF7StringEncoding", NSUTF7StringEncoding },
{ @"NSGSM0338StringEncoding", NSGSM0338StringEncoding },
{ @"NSBIG5StringEncoding", NSBIG5StringEncoding },
{ @"NSKoreanEUCStringEncoding", NSKoreanEUCStringEncoding },
{ nil, 0 }
};
@implementation EOAdaptor
+ (id)adaptorWithModel: (EOModel *)model
@ -625,40 +587,24 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
- (NSStringEncoding)databaseEncoding
{
static NSMutableDictionary *encodingDictionary = nil;
NSDictionary *connectionDictionary;
NSString *encodingName;
NSString *encodingValue;
NSStringEncoding stringEncoding;
NSString *encodingValue;
NSStringEncoding stringEncoding;
EOFLOGObjectFnStartOrCond2(@"AdaptorLevel",@"EOAdaptor");
if (encodingDictionary == nil)
{
unsigned int i;
encodingDictionary = [[NSMutableDictionary alloc] initWithCapacity: 64];
for (i = 0; encodingMap[i].name != nil; i++)
{
NSNumber *val = [NSNumber numberWithInt: encodingMap[i].encoding];
[encodingDictionary setObject: val forKey: encodingMap[i].name];
}
}
encodingValue = [[self connectionDictionary] objectForKey: @"databaseEncoding"];
connectionDictionary = [self connectionDictionary];
encodingName = [connectionDictionary objectForKey: @"databaseEncoding"];
encodingValue = [encodingDictionary objectForKey: encodingName];
if (encodingValue == nil)
{
stringEncoding = [NSString defaultCStringEncoding];
{
stringEncoding = [NSString defaultCStringEncoding];
} else {
// + GSMimeDocument encodingFromCharset should be in NSString Additions,
// but better there than in GSWeb and GDL -- dw
stringEncoding = [GSMimeDocument encodingFromCharset:encodingValue];
if ((stringEncoding == 0)) {
return [NSString defaultCStringEncoding];
}
else
{
stringEncoding = [encodingValue intValue];
}
EOFLOGObjectFnStopOrCond2(@"AdaptorLevel", @"EOAdaptor");
}
return stringEncoding;
}
@ -668,10 +614,6 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
//Should be OK
SEL valueFactoryMethod;
EOFLOGObjectLevelArgs(@"gsdb", @"value=%@", value);
EOFLOGObjectLevelArgs(@"gsdb", @"attribute=%@", attribute);
valueFactoryMethod = [attribute valueFactoryMethod];
if (valueFactoryMethod)
@ -693,8 +635,6 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
else if ([value isKindOfClass: [NSData class]])
value = [self fetchedValueForDataValue: value
attribute: attribute];
EOFLOGObjectLevelArgs(@"gsdb",@"value=%@",value);
}
if(_delegateRespondsTo.processValue)
@ -702,8 +642,6 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
fetchedValueForValue: value
attribute: attribute];
EOFLOGObjectLevelArgs(@"gsdb", @"value=%@", value);
return value;
}
@ -712,10 +650,6 @@ static struct { NSString *name; NSStringEncoding encoding; } encodingMap[] = {
attribute: (EOAttribute *)attribute
{
NSString *resultValue = nil;
EOFLOGObjectLevelArgs(@"gsdb", @"value=%@", value);
EOFLOGObjectLevelArgs(@"gsdb", @"attribute=%@", attribute);
if([value length]>0)
{

View file

@ -1208,6 +1208,7 @@ return nexexp
return value;
}
/**
* Returns a NSString or a custom-class value object
* from the supplied set of bytes using encoding.
@ -1221,94 +1222,96 @@ return nexexp
{
NSString* value = nil;
Class valueClass = [self _valueClass];
if (valueClass != Nil && valueClass != GDL2_NSStringClass)
{
switch (_argumentType)
{
switch (_argumentType)
{
case EOFactoryMethodArgumentIsNSString:
{
NSString *string = nil;
string = [(GDL2_alloc(NSString)) initWithBytes: bytes
length: length
encoding: encoding];
// If we have a value factiry method, call it to get the final value
if(_valueFactoryMethod != NULL)
{
value = [((id)valueClass) performSelector: _valueFactoryMethod
withObject: string];
if ( value != string)
{
//For efficiency reasons, the returned value is NOT autoreleased !
RETAIN(value);
RELEASE(string);
};
}
else
{
//For efficiency reasons, the returned value is NOT autoreleased !
value = string;
};
break;
}
case EOFactoryMethodArgumentIsBytes:
{
NSMethodSignature *aSignature = nil;
NSInvocation *anInvocation = nil;
// TODO: verify with WO
NSAssert2(_valueFactoryMethod,
@"No _valueFactoryMethod (valueFactoryMethodName=%@) in attribute %@",
_valueFactoryMethodName,self);
// First find signature for method
aSignature
= [valueClass methodSignatureForSelector: _valueFactoryMethod];
// Create the invocation object
anInvocation
= [NSInvocation invocationWithMethodSignature: aSignature];
// Put the selector
[anInvocation setSelector: _valueFactoryMethod];
// The target is the custom value class
[anInvocation setTarget: valueClass];
// arguments are buffer pointer, length and encoding
[anInvocation setArgument: &bytes atIndex: 2];
[anInvocation setArgument: &length atIndex: 3];
[anInvocation setArgument: &encoding atIndex: 4];
// Let's invoke the method
[anInvocation invoke];
// Get the returned value
[anInvocation getReturnValue: &value];
case EOFactoryMethodArgumentIsNSString:
{
NSString *string = nil;
string = [(GDL2_alloc(NSString)) initWithBytes: bytes
length: length
encoding: encoding];
// If we have a value factiry method, call it to get the final value
if(_valueFactoryMethod != NULL)
{
value = [((id)valueClass) performSelector: _valueFactoryMethod
withObject: string];
if ( value != string)
{
//For efficiency reasons, the returned value is NOT autoreleased !
// valueFactoryMethod returns an autoreleased value
RETAIN(value);
break;
}
case EOFactoryMethodArgumentIsNSData:
// TODO: verify with WO
break;
RELEASE(string);
};
}
else
{
//For efficiency reasons, the returned value is NOT autoreleased !
value = string;
};
return value;
//break;
}
case EOFactoryMethodArgumentIsBytes:
{
NSMethodSignature *aSignature = nil;
NSInvocation *anInvocation = nil;
// TODO: verify with WO
NSAssert2(_valueFactoryMethod,
@"No _valueFactoryMethod (valueFactoryMethodName=%@) in attribute %@",
_valueFactoryMethodName,self);
// First find signature for method
aSignature
= [valueClass methodSignatureForSelector: _valueFactoryMethod];
// Create the invocation object
anInvocation
= [NSInvocation invocationWithMethodSignature: aSignature];
// Put the selector
[anInvocation setSelector: _valueFactoryMethod];
// The target is the custom value class
[anInvocation setTarget: valueClass];
// arguments are buffer pointer, length and encoding
[anInvocation setArgument: &bytes atIndex: 2];
[anInvocation setArgument: &length atIndex: 3];
[anInvocation setArgument: &encoding atIndex: 4];
// Let's invoke the method
[anInvocation invoke];
// Get the returned value
[anInvocation getReturnValue: &value];
//For efficiency reasons, the returned value is NOT autoreleased !
// valueFactoryMethod returns an autoreleased value
RETAIN(value);
return value;
//break;
}
case EOFactoryMethodArgumentIsNSData:
// TODO: verify with WO
break;
}
}
if(!value)
{
//For efficiency reasons, the returned value is NOT autoreleased !
value = [(GDL2_alloc(NSString)) initWithBytes: bytes
length: length
encoding: encoding];
}
{
//For efficiency reasons, the returned value is NOT autoreleased !
value = [(GDL2_alloc(NSString)) initWithBytes: bytes
length: length
encoding: encoding];
}
return value;
}

View file

@ -274,12 +274,8 @@ static NSString *typeNames[][2] = {
{
Class expressionClass;
EOFLOGObjectFnStart();
expressionClass = [PostgreSQLExpression class];
EOFLOGObjectFnStop();
return expressionClass;
}
@ -378,8 +374,6 @@ static NSString *typeNames[][2] = {
PGconn *pgConn = NULL;
PGresult *pgResult = NULL;
NSString *str = nil;
EOFLOGObjectFnStart();
//OK
str = [_connectionDictionary objectForKey: @"databaseServer"];
@ -441,8 +435,6 @@ static NSString *typeNames[][2] = {
}
}
EOFLOGObjectFnStop();
return pgConn;
}

View file

@ -50,20 +50,20 @@
@interface PostgreSQLChannel : EOAdaptorChannel
{
PostgreSQLContext *_adaptorContext;
PGconn *_pgConn;
PGresult *_pgResult;
NSArray *_attributes;
NSArray *_origAttributes;
EOSQLExpression *_sqlExpression;
int _currentResultRow;
PostgreSQLContext *_adaptorContext;
PGconn *_pgConn;
PGresult *_pgResult;
NSArray *_attributes;
NSArray *_origAttributes;
EOSQLExpression *_sqlExpression;
int _currentResultRow;
NSMutableDictionary *_oidToTypeName;
BOOL _isFetchInProgress;
BOOL _evaluateExprInProgress;
BOOL _fetchBlobsOid;
NSArray *_pkAttributeArray;
int _pgVersion;
NSStringEncoding encoding;
BOOL _isFetchInProgress;
BOOL _evaluateExprInProgress;
BOOL _fetchBlobsOid;
NSArray *_pkAttributeArray;
int _pgVersion;
NSStringEncoding _encoding;
struct {
unsigned int postgresInsertedRowOid:1;

View file

@ -59,7 +59,6 @@ RCS_ID("$Id$")
#include <Foundation/NSTimeZone.h>
#else
#include <Foundation/Foundation.h>
#include <GNUstepBase/GSCategories.h>
#endif
#ifndef GNUSTEP
@ -330,9 +329,13 @@ newValueForCharactersTypeLengthAttribute (const void *bytes,
EOAttribute *attribute,
NSStringEncoding encoding)
{
return [attribute newValueForBytes: bytes
length: length
encoding: encoding];
id newValue = nil;
newValue = [attribute newValueForBytes: bytes
length: length
encoding: encoding];
return newValue;
}
static id
@ -526,8 +529,7 @@ newValueForBytesLengthAttribute (const void *bytes,
ASSIGN(_pkAttributeArray, [NSArray arrayWithObject: attr]);
RELEASE(attr);
//TODO: set encoding via connection dictionary and use throught adaptor.
encoding = [NSString defaultCStringEncoding];
_encoding = [[adaptorContext adaptor] databaseEncoding];
}
return self;
@ -600,20 +602,15 @@ newValueForBytesLengthAttribute (const void *bytes,
{
EOAdaptorContext *adaptorContext = nil;
EOFLOGObjectFnStart();
adaptorContext = [self adaptorContext];
[self cleanupFetch];
//NO ?? [self _cancelResults];//Done in cleanup fetch
// [_adaptorContext autoCommitTransaction];//Done in cleanup fetch
EOFLOGObjectFnStop();
}
- (void)_cancelResults
{
EOFLOGObjectFnStart();
_fetchBlobsOid = NO;
DESTROY(_attributes);
@ -628,7 +625,6 @@ newValueForBytesLengthAttribute (const void *bytes,
_isFetchInProgress = NO;
EOFLOGObjectFnStop();
}
- (BOOL)advanceRow
@ -636,8 +632,6 @@ newValueForBytesLengthAttribute (const void *bytes,
BOOL advanceRow = NO;
// fetch results where read then freed
EOFLOGObjectFnStart();
if (_pgResult)
{
// next row
@ -652,7 +646,6 @@ newValueForBytesLengthAttribute (const void *bytes,
advanceRow = YES;
}
EOFLOGObjectFnStop();
return advanceRow;
}
@ -671,7 +664,7 @@ newValueForBytesLengthAttribute (const void *bytes,
unsigned length = szName ? strlen(szName) : 0;
NSString *name = [(PSQLA_alloc(NSString)) initWithBytes: szName
length: length
encoding: encoding];
encoding: _encoding];
PSQLA_AddObjectWithImpPtr(names,&namesAO,name);
RELEASE(name);
}
@ -681,41 +674,18 @@ newValueForBytesLengthAttribute (const void *bytes,
- (NSMutableDictionary *)fetchRowWithZone: (NSZone *)zone
{
//TODO
/*
//self cleanupFetch quand plus de row !!
valueClassName...externaltype on each attr
self adaptorContext
context adaptor
adaptor databaseEncoding//2
self dictionaryWithObjects:???
forAttributes:_attributes
zone:zone
//end
*/
NSMutableDictionary *dict = nil;
EOFLOGObjectFnStart();
if (_delegateRespondsTo.willFetchRow)
[_delegate adaptorChannelWillFetchRow: self];
NSDebugMLLog(@"gsdb",@"[self isFetchInProgress]: %s",
([self isFetchInProgress] ? "YES" : "NO"));
if ([self isFetchInProgress])
{
NSDebugMLLog(@"gsdb", @"ATTRIBUTES=%@", _attributes);
if ([self isFetchInProgress])
{
if (!_attributes)
[self _describeResults];
if ([self advanceRow] == NO)
{
NSDebugMLLog(@"gsdb", @"No Advance Row", "");
{
// Return nil to indicate that the fetch operation was finished
if (_delegateRespondsTo.didFinishFetching)
[_delegate adaptorChannelDidFinishFetching: self];
@ -734,8 +704,8 @@ newValueForBytesLengthAttribute (const void *bytes,
{
[NSException raise: PostgreSQLException
format: @"attempt to read %d attributes "
@"when the result set has only %d columns",
count, PQnfields(_pgResult)];
@"when the result set has only %d columns",
count, PQnfields(_pgResult)];
}
if (count > 100)
@ -769,7 +739,7 @@ newValueForBytesLengthAttribute (const void *bytes,
string = [self _readBinaryDataRow: (Oid)atol(string)
length:&length zone: zone];
values[i] = newValueForBytesLengthAttribute(string,length,attr,encoding);
values[i] = newValueForBytesLengthAttribute(string,length,attr,_encoding);
}
else
{
@ -787,7 +757,7 @@ newValueForBytesLengthAttribute (const void *bytes,
else
{
//For efficiency reasons, the returned value is NOT autoreleased !
values[i] = newValueForBytesLengthAttribute(string,length,attr,encoding);
values[i] = newValueForBytesLengthAttribute(string,length,attr,_encoding);
}
}
@ -951,7 +921,9 @@ newValueForBytesLengthAttribute (const void *bytes,
//call PostgreSQLChannel numberOfAffectedRows
/* Send the expression to the SQL server */
_pgResult = PQexec(_pgConn, (char *)[[[expression statement] stringByAppendingString:@";"] cStringUsingEncoding: encoding]);
_pgResult = PQexec(_pgConn, (char *)[[[expression statement] stringByAppendingString:@";"]
cStringUsingEncoding: _encoding]);
affectedRows = strtoul(PQcmdTuples(_pgResult), NULL, 10);
if (_pgResult == NULL)
@ -988,8 +960,6 @@ newValueForBytesLengthAttribute (const void *bytes,
{
PostgreSQLContext *adaptorContext = nil;
EOFLOGObjectFnStart();
//_evaluationIsDirectCalled=1
adaptorContext = (PostgreSQLContext *)[self adaptorContext];
//call expression statement
@ -1037,7 +1007,6 @@ newValueForBytesLengthAttribute (const void *bytes,
[_delegate adaptorChannel: self didEvaluateExpression: expression];
}
EOFLOGObjectFnStop();
}
- (void)insertRow: (NSDictionary *)row
@ -1053,8 +1022,6 @@ newValueForBytesLengthAttribute (const void *bytes,
IMP nrowSOFK=NULL; // setObject:forKey:
IMP nrowOFK=NULL; // objectForKey:
EOFLOGObjectFnStart();
NSDebugMLLog(@"gsdb", @"row=%@", row);
if (![self isOpen])
@ -1113,33 +1080,28 @@ each key
NSDebugMLLog(@"gsdb", @"value=%@", value);
externalType = [attribute externalType];
NSDebugMLLog(@"gsdb", @"externalType=%@", externalType);
/* Insert the binary value into the binaryDataRow dictionary */
if ([externalType isEqual: @"inversion"])
{
id binValue = PSQLA_ObjectForKeyWithImpPtr(nrow,&nrowOFK,attrName);
Oid binOid = [self _insertBinaryData: binValue
forAttribute: attribute];
value = [NSNumber numberWithLong: binOid];
}
else if ([externalType isEqual: @"NSString"]) //??
{
//TODO: database encoding
// [[adaptorContext adaptor] databaseEncoding]
}
{
id binValue = PSQLA_ObjectForKeyWithImpPtr(nrow,&nrowOFK,attrName);
Oid binOid = [self _insertBinaryData: binValue
forAttribute: attribute];
value = [NSNumber numberWithLong: binOid];
} else if ([externalType isEqual: @"NSString"]) {
value = [value dataUsingEncoding:_encoding];
}
PSQLA_SetObjectForKeyWithImpPtr(nrow,&nrowSOFK,value,attrName);
}
NSDebugMLLog(@"gsdb", @"nrow=%@", nrow);
if ([nrow count] > 0)
{
sqlexpr = [[[_adaptorContext adaptor] expressionClass]
insertStatementForRow: nrow
entity: entity];
NSDebugMLLog(@"gsdb", @"sqlexpr=%@", sqlexpr);
if ([self _evaluateExpression: sqlexpr withAttributes: nil] == NO) //call evaluateExpression:
[NSException raise: EOGeneralAdaptorException
@ -1152,7 +1114,6 @@ each key
[_adaptorContext autoCommitTransaction];
EOFLOGObjectFnStop();
}
- (unsigned)deleteRowsDescribedByQualifier: (EOQualifier *)qualifier
@ -1162,8 +1123,6 @@ each key
unsigned long rows = 0;
PostgreSQLContext *adaptorContext;
EOFLOGObjectFnStart();
if (![self isOpen])
[NSException raise: NSInternalInconsistencyException
format: @"%@ -- %@ 0x%x: attempt to delete rows with no open channel",
@ -1199,7 +1158,6 @@ each key
[adaptorContext autoCommitTransaction];
EOFLOGObjectFnStop();
return rows;
}
@ -1223,8 +1181,6 @@ each key
//a con autoBeginTransaction
//end
EOFLOGObjectFnStart();
NSDebugMLLog(@"gsdb",@"%@ -- %@ 0x%x: isFetchInProgress=%s",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
@ -1253,20 +1209,8 @@ each key
entity: entity])
return;
NSDebugMLLog(@"gsdb", @"%@ -- %@ 0x%x: isFetchInProgress=%s",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
self,
([self isFetchInProgress] ? "YES" : "NO"));
[self _cancelResults];
NSDebugMLLog(@"gsdb", @"%@ -- %@ 0x%x: isFetchInProgress=%s",
NSStringFromSelector(_cmd),
NSStringFromClass([self class]),
self,
([self isFetchInProgress] ? "YES" : "NO"));
[_adaptorContext autoBeginTransaction: NO];
ASSIGN(_attributes, attributes);
@ -1281,16 +1225,10 @@ each key
fetchSpecification: fetchSpecification
entity: entity];
NSDebugMLLog(@"gsdb", @"sqlExpr=%@", sqlExpr);
// NSDebugMLLog(@"gsdb",@"AA attributes=%@",_attributes);
[self _evaluateExpression: sqlExpr
withAttributes: attributes];
NSDebugMLLog(@"gsdb", @"After _evaluate", "");
// NSDebugMLLog(@"gsdb",@"BB attributes=%@",_attributes);
[_adaptorContext autoCommitTransaction];
NSDebugMLLog(@"gsdb", @"After autoCommitTransaction", "");
if (_delegateRespondsTo.didSelectAttributes)
[_delegate adaptorChannel: self
@ -1298,9 +1236,7 @@ each key
fetchSpecification: fetchSpecification
lock: flag
entity: entity];
// NSDebugMLLog(@"gsdb",@"CC attributes=%@",_attributes);
EOFLOGObjectFnStop();
}
- (unsigned int)updateValues: (NSDictionary *)values
@ -1329,8 +1265,6 @@ each key
PostgreSQLContext *adaptorContext = nil;
unsigned long rows = 0;
IMP valuesOFK=NULL; // objectForKey:
EOFLOGObjectFnStart();
if (![self isOpen])
[NSException raise: NSInternalInconsistencyException
@ -1451,7 +1385,6 @@ each key
[adaptorContext autoCommitTransaction];
}
EOFLOGObjectFnStop();
return rows;
}
@ -2252,8 +2185,6 @@ each key
NSString *sequenceName;
EOSQLExpression *expr;
EOFLOGObjectFnStart();
primaryKeySequenceNameFormat
= [(PostgreSQLContext*)[self adaptorContext] primaryKeySequenceNameFormat];
NSAssert(primaryKeySequenceNameFormat, @"No primary sequence name format");
@ -2285,7 +2216,7 @@ each key
length = PQgetlength(_pgResult, _currentResultRow, 0);
attr = [_pkAttributeArray objectAtIndex: 0];
pkValue = AUTORELEASE(newValueForBytesLengthAttribute(string,length,attr,encoding));
pkValue = AUTORELEASE(newValueForBytesLengthAttribute(string,length,attr,_encoding));
NSAssert(pkValue, @"no pk value");
key = [[entity primaryKeyAttributeNames] objectAtIndex: 0];
@ -2298,7 +2229,6 @@ each key
forKey: key];
}
EOFLOGObjectFnStop();
return pk;
}
@ -2307,8 +2237,6 @@ each key
{
PostgreSQLContext *adaptorContext;
EOFLOGObjectFnStart();
adaptorContext = (PostgreSQLContext *)[self adaptorContext];
NSDebugMLog(@"[self isFetchInProgress]=%s",
@ -2326,8 +2254,6 @@ each key
//_isTransactionstarted to 0
//_evaluationIsDirectCalled=0
}
EOFLOGObjectFnStop();
}
@end /* PostgreSQLChannel */

View file

@ -31,11 +31,11 @@
</license>
**/
#if !HAVE_DECL_PQFREEMEM
#if 0 //!HAVE_DECL_PQFREEMEM
#define PQfreemem free
#endif
#if !HAVE_DECL_PQUNESCAPEBYTEA
#if 0 //!HAVE_DECL_PQUNESCAPEBYTEA
#include <stdlib.h>
#include <string.h>

View file

@ -38,7 +38,6 @@ RCS_ID("$Id$")
#ifndef GNUSTEP
#include <GNUstepBase/GNUstep.h>
#include <GNUstepBase/GSCategories.h>
#endif
#include <EOControl/EONull.h>